qrexec-daemon: fix pathological break-out-of-wait-loop

If the timeout is 1, attempting to retry would not actually retry,
since i would be incremented just after being reset to 0, and would
thus break out of the loop.
This commit is contained in:
Vincent Penquerc'h 2013-12-27 14:33:18 -05:00 committed by Marek Marczykowski-Górecki
parent e88faee9dd
commit 5e4e1fe6ac

View File

@ -173,7 +173,7 @@ void init(int xid)
fprintf(stderr, ".");
if (i==startup_timeout-1) {
if (ask_on_connect_timeout(xid, startup_timeout))
i=0;
i=-1;
}
}
fprintf(stderr, "Cannot connect to qrexec agent for %d seconds, giving up\n", startup_timeout);