} while(n < 0 && errno == EINTR);
xsigprocmask(SIG_BLOCK, &ev->sigmask, 0);
if(n < 0) {
} while(n < 0 && errno == EINTR);
xsigprocmask(SIG_BLOCK, &ev->sigmask, 0);
if(n < 0) {
if(errno == EBADF) {
/* If there's a bad FD in the mix then check them all and log what we
* find, to ease debugging */
if(errno == EBADF) {
/* If there's a bad FD in the mix then check them all and log what we
* find, to ease debugging */
- error(errno, "mode %s fstat %d (%s)",
- modenames[mode], fd, ev->mode[mode].fds[n].what);
+ disorder_error(errno, "mode %s fstat %d (%s)",
+ modenames[mode], fd, ev->mode[mode].fds[n].what);
}
for(n = 0; n <= maxfd; ++n)
if(FD_ISSET(n, &ev->mode[mode].enabled)
&& fstat(n, &sb) < 0)
}
for(n = 0; n <= maxfd; ++n)
if(FD_ISSET(n, &ev->mode[mode].enabled)
&& fstat(n, &sb) < 0)
- error(errno, "mode %s fstat %d", modenames[mode], n);
+ disorder_error(errno, "mode %s fstat %d", modenames[mode], n);
- error(errno, "error calling wait4 for PID %lu (broken ptrace?)",
- (unsigned long)ev->children[n].pid);
+ disorder_error(errno, "error calling wait4 for PID %lu (broken ptrace?)",
+ (unsigned long)ev->children[n].pid);
for(n = 0; n < ev->nchildren; ++n) {
if(kill(ev->children[n].pid, SIGTERM) < 0) {
for(n = 0; n < ev->nchildren; ++n) {
if(kill(ev->children[n].pid, SIGTERM) < 0) {
- error(errno, "sending SIGTERM to pid %lu",
- (unsigned long)ev->children[n].pid);
+ disorder_error(errno, "sending SIGTERM to pid %lu",
+ (unsigned long)ev->children[n].pid);
rc = waitpid(ev->children[n].pid, &w, 0);
} while(rc < 0 && errno == EINTR);
if(rc < 0) {
rc = waitpid(ev->children[n].pid, &w, 0);
} while(rc < 0 && errno == EINTR);
if(rc < 0) {
- error(errno, "waiting for pid %lu", (unsigned long)ev->children[n].pid);
+ disorder_error(errno, "waiting for pid %lu",
+ (unsigned long)ev->children[n].pid);
break;
#endif
#ifdef EPROTO
case EPROTO:
/* XXX on some systems EPROTO should be fatal, but we don't know if
* we're running on one of them */
break;
#endif
#ifdef EPROTO
case EPROTO:
/* XXX on some systems EPROTO should be fatal, but we don't know if
* we're running on one of them */
- error(0, "abandoning writer '%s' because no writes within %ds",
- w->what, w->timebound);
+ disorder_error(0, "abandoning writer '%s' because no writes within %ds",
+ w->what, w->timebound);
if(w->spacebound && w->b.end - w->b.start + n > w->spacebound) {
/* The new buffer contents will exceed the space bound. We assume that the
* remote client has gone away and TCP hasn't noticed yet, or that it's got
* hopelessly stuck. */
if(!w->abandoned) {
w->abandoned = 1;
if(w->spacebound && w->b.end - w->b.start + n > w->spacebound) {
/* The new buffer contents will exceed the space bound. We assume that the
* remote client has gone away and TCP hasn't noticed yet, or that it's got
* hopelessly stuck. */
if(!w->abandoned) {
w->abandoned = 1;
- error(0, "abandoning writer '%s' because buffer has reached %td bytes",
- w->what, w->b.end - w->b.start);
+ disorder_error(0, "abandoning writer '%s' because buffer has reached %td bytes",
+ w->what, w->b.end - w->b.start);
ev_fd_disable(w->ev, ev_write, w->fd);
w->error = EPIPE;
return ev_timeout(w->ev, 0, 0, writer_shutdown, w);
ev_fd_disable(w->ev, ev_write, w->fd);
w->error = EPIPE;
return ev_timeout(w->ev, 0, 0, writer_shutdown, w);