Abort if we could not write the signal number to the pipe (which
should never happen).
*/
static void generic_signal_handler(int s)
{
- write(signal_pipe[1], &s, sizeof(int));
- //fprintf(stderr, "got sig %i, write returned %d\n", s, ret);
+ ssize_t ret = write(signal_pipe[1], &s, sizeof(int));
+
+ if (ret == sizeof(int))
+ return;
+ if (ret < 0)
+ PARA_EMERG_LOG("%s\n", strerror(errno));
+ else
+ PARA_EMERG_LOG("short write to signal pipe\n");
+ exit(EXIT_FAILURE);
}
/**