if (sigaction(SIGALRM,&sig,0)) syscallerror("set up sigalrm handler");
if (!timeout) return;
- if (alarm(timeout)<0) syscallerror("set up timeout alarm");
+ alarm(timeout);
}
Thanks to report from Nelson Beebe.
* Correct an erroneous assert() argument so that it would actually
detect failure of the assertion.
+ * alarm(2) returns unsigned and can never fail.
Packaging changes:
* Reran flex (flex Debian 2.5.31-31).
(long)checkpid,status);
}
checkpid= -1;
- ar= alarm(USERVD_MYSELF_CHECK);
- if (ar<0) { syslog(LOG_CRIT,"set alarm for next check: %m"); exit(5); }
+ alarm(USERVD_MYSELF_CHECK);
} else {
if (WIFSIGNALED(status)) {
syslog(LOG_ERR,"call pid %ld %s due to signal %s",
syslog(LOG_ERR,"unable to connect to uservd daemon: %m"); exit(1);
}
- r= alarm(USERVD_MYSELF_TIMEOUT);
- if (r<0) { syslog(LOG_ERR,"set alarm for read: %m"); exit(1); }
+ alarm(USERVD_MYSELF_TIMEOUT);
remain= sizeof(opening_mbuf); p= (unsigned char*)&opening_mbuf;
while (remain) {
r= read(sfd,p,remain);
break;
} else if (errno==EAGAIN) {
syslog(LOG_ERR,"fork for check - will wait and retry: %m");
- r= alarm(USERVD_CHECKFORK_RETRY);
- if (r<0) { syslog(LOG_CRIT,"set alarm for retry check: %m"); exit(5); }
+ alarm(USERVD_CHECKFORK_RETRY);
break;
} else if (errno!=EINTR) {
syslog(LOG_CRIT,"fork for check: %m"); exit(5);