+ if (r < 0) {
+ if (errno == EAGAIN || errno == EINTR)
+ return 0;
+ return -ERRNO_TO_PARA_ERROR(errno);
+ }
+ assert(r == sizeof(s));
+ PARA_DEBUG_LOG("next signal: %d\n", s);
+ return s;
+}
+
+/**
+ * Close the write end of the signal pipe.
+ */
+void para_signal_shutdown(void)
+{
+ close(signal_pipe[1]);