summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorMike Christie <michael.christie@oracle.com>2021-12-03 17:42:59 -0600
committerMike Christie <michael.christie@oracle.com>2021-12-03 18:10:14 -0600
commit98518390260056988803469105ed6fcccfbf650e (patch)
treee74d94624f962ba4105452aace8617b4538dd7d5 /usr
parent403cd999c537ad13fe0dc108da44f00e1b17eeed (diff)
downloadopen-iscsi-98518390260056988803469105ed6fcccfbf650e.tar.gz
iscsid: use infinite timeout if passed in
If the caller passes in -1 for the timeout then we can just pass that to poll instead of waking up and retrying the poll over and over. Signed-off-by: Mike Christie <michael.christie@oracle.com>
Diffstat (limited to 'usr')
-rw-r--r--usr/iscsid_req.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/usr/iscsid_req.c b/usr/iscsid_req.c
index 596086e..875c58f 100644
--- a/usr/iscsid_req.c
+++ b/usr/iscsid_req.c
@@ -141,12 +141,7 @@ int iscsid_response(int fd, iscsiadm_cmd_e cmd, iscsiadm_rsp_t *rsp,
size_t len = sizeof(*rsp);
int iscsi_err = ISCSI_ERR_ISCSID_COMM_ERR;
int err;
- int poll_wait = 0;
- if (timeout == -1) {
- timeout = ISCSID_REQ_TIMEOUT;
- poll_wait = 1;
- }
while (len) {
struct pollfd pfd;
@@ -154,8 +149,6 @@ int iscsid_response(int fd, iscsiadm_cmd_e cmd, iscsiadm_rsp_t *rsp,
pfd.events = POLLIN;
err = poll(&pfd, 1, timeout);
if (!err) {
- if (poll_wait)
- continue;
return ISCSI_ERR_SESSION_NOT_CONNECTED;
} else if (err < 0) {
if (errno == EINTR)