From a75727d9896a57223089f33feccf6c0b391d5d30 Mon Sep 17 00:00:00 2001 From: Peter Lieven Date: Sat, 17 Nov 2012 19:59:35 +0100 Subject: [PATCH] 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 --- lib/connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/connect.c b/lib/connect.c index b73f08e..1d44ebb 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -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: