SYNC set status to -1 on error in event_loop
If there is an error in iscsi_service or on poll we exit the event_loop. But in this case scsi_sync_cb is never reached and the status is 0. This will make the caller think that the sync task has been completed successfully.
This commit is contained in:
committed by
Ronnie Sahlberg
parent
577d37c5ed
commit
30804507f9
@@ -47,6 +47,7 @@ event_loop(struct iscsi_context *iscsi, struct iscsi_sync_state *state)
|
||||
|
||||
if ((ret = poll(&pfd, 1, 1000)) < 0) {
|
||||
iscsi_set_error(iscsi, "Poll failed");
|
||||
state->status = -1;
|
||||
return;
|
||||
}
|
||||
if (ret == 0) {
|
||||
@@ -57,6 +58,7 @@ event_loop(struct iscsi_context *iscsi, struct iscsi_sync_state *state)
|
||||
iscsi_set_error(iscsi,
|
||||
"iscsi_service failed with : %s",
|
||||
iscsi_get_error(iscsi));
|
||||
state->status = -1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user