From 90c18c6f5e7a65f5ecf64392e6a4aa432ed325f5 Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Mon, 9 Mar 2009 18:58:01 +0100 Subject: [PATCH] Make selfpipe read/write errors nonfatal die in signal handler is unsafe and the errors should not cause anything really bad anyway. --- ucw/mainloop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ucw/mainloop.c b/ucw/mainloop.c index c348ecd1..92a1cc1c 100644 --- a/ucw/mainloop.c +++ b/ucw/mainloop.c @@ -259,7 +259,7 @@ main_sigchld_handler(int x UNUSED) 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"); errno = old_errno; } @@ -268,8 +268,8 @@ dummy_read_handler(struct main_file *mp) { 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; } -- 2.39.5