if(got_exit_signal)
break;
- rc = select((int)maxfd + 1, &input, &output, NULL, &timeout);
+ do {
+ rc = select((int)maxfd + 1, &input, &output, NULL, &timeout);
+ } while(rc < 0 && errno == EINTR && !got_exit_signal);
+
+ if(got_exit_signal)
+ break;
if(rc > 0) {
/* socket action */
- bool tcp_fin_wr;
+ bool tcp_fin_wr = FALSE;
timeout_count = 0;
- if(got_exit_signal)
- break;
-
- tcp_fin_wr = FALSE;
-
/* ---------------------------------------------------------- */
/* passive mode FTP may establish a secondary tunnel */
if(got_exit_signal)
goto sws_cleanup;
- rc = select((int)maxfd + 1, &input, &output, NULL, &timeout);
+ do {
+ rc = select((int)maxfd + 1, &input, &output, NULL, &timeout);
+ } while(rc < 0 && errno == EINTR && !got_exit_signal);
+
+ if(got_exit_signal)
+ goto sws_cleanup;
+
if(rc < 0) {
error = SOCKERRNO;
logmsg("select() failed with error: (%d) %s",
goto sws_cleanup;
}
- if(got_exit_signal)
- goto sws_cleanup;
-
if(rc == 0) {
/* Timed out - try again */
continue;