RECONNECT avoid deadlock on reconnect retry timeout

If there is a clock jump e.g. due to daylight saving time
the wait can be almost infinite
This commit is contained in:
Peter Lieven
2012-11-17 19:59:35 +01:00
committed by Ronnie Sahlberg
parent 328755fb68
commit a75727d989

View File

@@ -222,7 +222,7 @@ int iscsi_reconnect(struct iscsi_context *old_iscsi)
int retry = 0;
if (old_iscsi->last_reconnect) {
while (time(NULL) - old_iscsi->last_reconnect < 5) sleep(1);
if (time(NULL) - old_iscsi->last_reconnect < 5) sleep(5);
}
try_again: