diff options
author | Greg Kurz <groug@kaod.org> | 2019-09-05 18:28:53 +0200 |
---|---|---|
committer | Alastair D'Silva <deece@users.noreply.github.com> | 2019-09-06 20:42:41 +1000 |
commit | 9b4d7efc89dd5059a683a22506dd6276d81abb01 (patch) | |
tree | 2918fdb03ca043a41dc00b4750b105213d609e3d | |
parent | 684eecead6f37229c527b29ffd2c40707da34860 (diff) |
irq: Print out errno when irq allocation fails
When ioctl() fails it always returns -1 and it puts the actual error in
errno.
Signed-off-by: Greg Kurz <groug@kaod.org>
-rw-r--r-- | src/irq.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -112,13 +112,13 @@ static ocxl_err irq_allocate(ocxl_afu *afu, ocxl_irq *irq, void *info) int rc = ioctl(afu->fd, OCXL_IOCTL_IRQ_ALLOC, &irq->event.irq_offset); if (rc) { - errmsg(afu, ret, "Could not allocate IRQ in kernel: %d", rc); + errmsg(afu, ret, "Could not allocate IRQ in kernel: %d: '%s'", errno, strerror(errno)); goto errend; } rc = ioctl(afu->fd, OCXL_IOCTL_IRQ_SET_FD, &irq->event); if (rc) { - errmsg(afu, ret, "Could not set event descriptor in kernel: %d", rc); + errmsg(afu, ret, "Could not set event descriptor in kernel: %d: '%s'", errno, strerror(errno)); goto errend; } |