Skip to content

Commit

Permalink
lib: finish event_loop on invalid fd
Browse files Browse the repository at this point in the history
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.

Change-Id: Ibad0353dcf50fc7d65332052254d69953595415e
  • Loading branch information
Tianren Zhang committed Nov 27, 2024
1 parent 041f12d commit d7e74ba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit d7e74ba

Please sign in to comment.