libiscsi: continue working when meets EINTR or EAGAIN
authorKyle Zhang <kyle@smartx.com>
Fri, 19 Jul 2019 07:50:01 +0000 (15:50 +0800)
committerKyle Zhang <kyle@smartx.com>
Fri, 19 Jul 2019 10:49:56 +0000 (18:49 +0800)
When poll meets EINTR or EAGAIN, it should continue working rather
than return error.

Signed-off-by: Kyle Zhang <kyle@smartx.com>
engines/libiscsi.c

index bea94c5..58667fb 100644 (file)
@@ -351,6 +351,9 @@ static int fio_iscsi_getevents(struct thread_data *td, unsigned int min,
 
                ret = poll(iscsi_info->pfds, iscsi_info->nr_luns, -1);
                if (ret < 0) {
+                       if (errno == EINTR || errno == EAGAIN) {
+                               continue;
+                       }
                        log_err("iscsi: failed to poll events: %s.\n",
                                strerror(errno));
                        break;