Don't abort select when on signals
This commit is contained in:
@@ -593,9 +593,10 @@ bool rc_wait_service (const char *service)
|
|||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
tv.tv_usec = WAIT_INTERVAL;
|
tv.tv_usec = WAIT_INTERVAL;
|
||||||
if (select (0, 0, 0, 0, &tv) < 0) {
|
if (select (0, 0, 0, 0, &tv) < 0) {
|
||||||
if (errno != EINTR)
|
if (errno != EINTR) {
|
||||||
eerror ("select: %s",strerror (errno));
|
eerror ("select: %s",strerror (errno));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't hang around forever */
|
/* Don't hang around forever */
|
||||||
|
@@ -374,9 +374,10 @@ static bool svc_exec (const char *service, const char *arg1, const char *arg2)
|
|||||||
retval = select (MAX (stdout_pipes[0], stderr_pipes[0]) + 1,
|
retval = select (MAX (stdout_pipes[0], stderr_pipes[0]) + 1,
|
||||||
&fds, 0, 0, 0);
|
&fds, 0, 0, 0);
|
||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
if (errno != EINTR)
|
if (errno != EINTR) {
|
||||||
eerror ("select: %s", strerror (errno));
|
eerror ("select: %s", strerror (errno));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
} else if (retval) {
|
} else if (retval) {
|
||||||
ssize_t nr;
|
ssize_t nr;
|
||||||
|
|
||||||
|
@@ -390,9 +390,10 @@ static int run_stop_schedule (const char *exec, const char *cmd,
|
|||||||
if (select (0, 0, 0, 0, &tv) < 0) {
|
if (select (0, 0, 0, 0, &tv) < 0) {
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
eerror ("%s: caught an interupt", progname);
|
eerror ("%s: caught an interupt", progname);
|
||||||
else
|
else {
|
||||||
eerror ("%s: select: %s", progname, strerror (errno));
|
eerror ("%s: select: %s", progname, strerror (errno));
|
||||||
return (0);
|
return (0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gettimeofday (&now, NULL) != 0) {
|
if (gettimeofday (&now, NULL) != 0) {
|
||||||
|
Reference in New Issue
Block a user