/*
- * Copyright (c) 2008, 2009, 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2011, 2012, 2013 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <config.h>
#include "signals.h"
-#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <signal.h>
static bool inited;
if (!inited) {
inited = true;
- xpipe(fds);
- xset_nonblocking(fds[0]);
- xset_nonblocking(fds[1]);
+ xpipe_nonblocking(fds);
}
}
s->signr = signr;
/* Set up signal handler. */
- assert(signr >= 1 && signr < N_SIGNALS);
+ ovs_assert(signr >= 1 && signr < N_SIGNALS);
memset(&sa, 0, sizeof sa);
sa.sa_handler = signal_handler;
sigemptyset(&sa.sa_mask);
}
void
-xsigprocmask(int how, const sigset_t *new, sigset_t *old)
+xpthread_sigmask(int how, const sigset_t *new, sigset_t *old)
{
- if (sigprocmask(how, new, old)) {
- VLOG_FATAL("sigprocmask failed (%s)", strerror(errno));
+ int error = pthread_sigmask(how, new, old);
+ if (error) {
+ VLOG_FATAL("pthread_sigmask failed (%s)", strerror(error));
}
}