mock: fix build warnings
Fix build warnings regarding unused result of write().
@@ -306,7 +306,9 @@ int ioctl(int fd, unsigned long request, ...)
if (gEnableIRQ && fme_irq->evtfd >= 0) {
uint64_t data = 1;
// Write to the eventfd to signal one IRQ event.
- write(fme_irq->evtfd, &data, sizeof(data));
+ if (write(fme_irq->evtfd, &data, sizeof(data)) != sizeof(data)) {
+ FPGA_ERR("IRQ write < 8 bytes");
+ }
}
retval = 0;
errno = 0;
@@ -433,7 +435,9 @@ int ioctl(int fd, unsigned long request, ...)
if (gEnableIRQ && port_irq->evtfd >= 0) {
uint64_t data = 1;
// Write to the eventfd to signal one IRQ event.
- write(port_irq->evtfd, &data, sizeof(data));
+ if (write(port_irq->evtfd, &data, sizeof(data)) != sizeof(data)) {
+ FPGA_ERR("IRQ write < 8 bytes");
+ }
}
retval = 0;
errno = 0;
@@ -460,7 +464,10 @@ int ioctl(int fd, unsigned long request, ...)
// Write to each eventfd to signal one IRQ event.
for (i = 0 ; i < uafu_irq->count ; ++i) {
if (uafu_irq->evtfd[i] >= 0)
- write(uafu_irq->evtfd[i], &data, sizeof(data));
+ if (write(uafu_irq->evtfd[i], &data, sizeof(data)) !=
+ sizeof(data)) {
+ FPGA_ERR("IRQ write < 8 bytes");
+ }
}
}
retval = 0;
