diff options
-rw-r--r-- | libpeci/peci.c | 5 | ||||
-rw-r--r-- | libpeci/peci.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/libpeci/peci.c b/libpeci/peci.c index 58079bc..4929547 100644 --- a/libpeci/peci.c +++ b/libpeci/peci.c @@ -13,6 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. */ +#include <errno.h> #include <fcntl.h> #include <peci.h> #include <string.h> @@ -114,6 +115,10 @@ static EPECIStatus HW_peci_issue_cmd(unsigned int cmd, char* cmdPtr, if (ioctl(peci_fd, cmd, cmdPtr) != 0) { + if (errno == ETIMEDOUT) + { + return PECI_CC_TIMEOUT; + } return PECI_CC_DRIVER_ERR; } diff --git a/libpeci/peci.h b/libpeci/peci.h index 33b664d..53a8bba 100644 --- a/libpeci/peci.h +++ b/libpeci/peci.h @@ -45,6 +45,7 @@ typedef enum PECI_CC_DRIVER_ERR, PECI_CC_CPU_NOT_PRESENT, PECI_CC_MEM_ERR, + PECI_CC_TIMEOUT, } EPECIStatus; // PECI Timeout Options |