summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2019-09-05 18:28:53 +0200
committerAlastair D'Silva <deece@users.noreply.github.com>2019-09-06 20:42:41 +1000
commit9b4d7efc89dd5059a683a22506dd6276d81abb01 (patch)
tree2918fdb03ca043a41dc00b4750b105213d609e3d
parent684eecead6f37229c527b29ffd2c40707da34860 (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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/irq.c b/src/irq.c
index 86b285c..603e7b9 100644
--- a/src/irq.c
+++ b/src/irq.c
@@ -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;
}