die in signal handler is unsafe and the errors should not cause anything
really bad anyway.
ssize_t result;
while((result = write(sig_pipe_send, "c", 1)) == -1 && errno == EINTR);
if(result == -1 && errno != EAGAIN)
ssize_t result;
while((result = write(sig_pipe_send, "c", 1)) == -1 && errno == EINTR);
if(result == -1 && errno != EAGAIN)
- die("Could not write to selfpipe: %m");
+ msg(L_SIGHANDLER|L_ERROR, "Could not write to self-pipe: %m");
{
char buffer[1024];
ssize_t result = read(mp->fd, buffer, 1024);
{
char buffer[1024];
ssize_t result = read(mp->fd, buffer, 1024);
- if(result == -1 && errno != EAGAIN && errno != EINTR)
- die("Could not read from selfpipe: %m");
+ if(result == -1 && errno != EAGAIN)
+ msg(L_ERROR, "Could not read from selfpipe: %m");
file_chg(mp);
return result == 1024;
}
file_chg(mp);
return result == 1024;
}