/* Success */
-if (rc >= 0) return 0;
+if (rc >= 0)
+ {
+ callout_address = string_sprintf("[%s]:%d", address, port);
+ return 0;
+ }
/* A failure whose error code is "Interrupted system call" is in fact
an externally applied timeout if the signal handler has been run. */
path, strerror(err));
return -1;
}
+callout_address = string_copy(path);
return sock;
}
int time_left = timeout;
int rc;
-if (timeout <= 0)
+if (time_left <= 0)
{
errno = ETIMEDOUT;
return FALSE;
if (rc < 0 && errno == EINTR)
{
DEBUG(D_transport) debug_printf("EINTR while waiting for socket data\n");
+
/* Watch out, 'continue' jumps to the condition, not to the loops top */
- if (time_left = timeout - (time(NULL) - start_recv)) continue;
+ time_left = timeout - (time(NULL) - start_recv);
+ if (time_left > 0) continue;
}
if (rc <= 0)