+ ignore(write(signals[signr].fds[1], "", 1));
+ }
+}
+
+/* Returns the name of signal 'signum' as a string. The return value is either
+ * a statically allocated constant string or the 'bufsize'-byte buffer
+ * 'namebuf'. 'bufsize' should be at least SIGNAL_NAME_BUFSIZE.
+ *
+ * The string is probably a (possibly multi-word) description of the signal
+ * (e.g. "Hangup") instead of just the stringified version of the macro
+ * (e.g. "SIGHUP"). */
+const char *
+signal_name(int signum, char *namebuf, size_t bufsize)
+{
+#if HAVE_DECL_SYS_SIGLIST
+ if (signum >= 0 && signum < N_SIGNALS) {
+ const char *name = sys_siglist[signum];
+ if (name) {
+ return name;
+ }
+ }
+#endif
+
+ snprintf(namebuf, bufsize, "signal %d", signum);
+ return namebuf;
+}
+
+void
+xsigaction(int signum, const struct sigaction *new, struct sigaction *old)
+{
+ if (sigaction(signum, new, old)) {
+ char namebuf[SIGNAL_NAME_BUFSIZE];
+
+ VLOG_FATAL("sigaction(%s) failed (%s)",
+ signal_name(signum, namebuf, sizeof namebuf),
+ ovs_strerror(errno));
+ }
+}
+
+void
+xpthread_sigmask(int how, const sigset_t *new, sigset_t *old)
+{
+ int error = pthread_sigmask(how, new, old);
+ if (error) {
+ VLOG_FATAL("pthread_sigmask failed (%s)", ovs_strerror(error));