lib: finish event_loop on invalid fd
When iscsi->fd gets invalid, there is not point to keep stuck in the event loop, instead could give an accurate error about the invalid fd. Signed-off-by: Tianren Zhang <tianren@smartx.com>
This commit is contained in:
@@ -91,6 +91,12 @@ event_loop(struct iscsi_context *iscsi, struct iscsi_sync_state *state)
|
||||
state->status = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (iscsi->fd < 0) {
|
||||
iscsi_set_error(iscsi, "Invalid fd %d", iscsi->fd);
|
||||
state->status = -1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user