#include <errno.h>
#include <getopt.h>
#include <libgen.h>
+#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
if (ret < 0)
exit(EXIT_FAILURE);
- ret = sigprocmask(SIG_SETMASK, &mask, &omask);
+ ret = pthread_sigmask(SIG_SETMASK, &mask, &omask);
if (ret < 0)
exit(EXIT_FAILURE);
}
}
- ret = sigprocmask(SIG_SETMASK, &omask, NULL);
+ ret = pthread_sigmask(SIG_SETMASK, &omask, NULL);
if (ret < 0) {
SYSERROR("Failed to set signal mask");
exit(EXIT_FAILURE);
if (ret < 0)
exit(EXIT_FAILURE);
- ret = sigprocmask(SIG_SETMASK, &omask, NULL);
+ ret = pthread_sigmask(SIG_SETMASK, &omask, NULL);
if (ret < 0) {
SYSERROR("Failed to set signal mask");
exit(EXIT_FAILURE);
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
+#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
sigdelset(&mask, SIGSEGV) ||
sigdelset(&mask, SIGBUS) ||
sigdelset(&mask, SIGTERM) ||
- sigprocmask(SIG_BLOCK, &mask, NULL)) {
+ pthread_sigmask(SIG_BLOCK, &mask, NULL)) {
SYSERROR("Failed to set signal mask.");
exit(EXIT_FAILURE);
}
#include <fcntl.h>
#include <grp.h>
#include <poll.h>
+#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
return -EBADF;
}
- ret = sigprocmask(SIG_BLOCK, &mask, oldmask);
+ ret = pthread_sigmask(SIG_BLOCK, &mask, oldmask);
if (ret < 0) {
SYSERROR("Failed to set signal mask");
return -EBADF;
return 0;
out_restore_sigmask:
- sigprocmask(SIG_SETMASK, &handler->oldmask, NULL);
+ pthread_sigmask(SIG_SETMASK, &handler->oldmask, NULL);
out_delete_tty:
lxc_delete_tty(&conf->ttys);
out_aborting:
}
/* Reset mask set by setup_signal_fd. */
- ret = sigprocmask(SIG_SETMASK, &handler->oldmask, NULL);
+ ret = pthread_sigmask(SIG_SETMASK, &handler->oldmask, NULL);
if (ret < 0)
WARN("%s - Failed to restore signal mask", strerror(errno));
goto out_warn_father;
}
- ret = sigprocmask(SIG_SETMASK, &handler->oldmask, NULL);
+ ret = pthread_sigmask(SIG_SETMASK, &handler->oldmask, NULL);
if (ret < 0) {
SYSERROR("Failed to set signal mask");
goto out_warn_father;
#include <errno.h>
#include <fcntl.h>
#include <lxc/lxccontainer.h>
+#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
goto on_error;
}
- ret = sigprocmask(SIG_BLOCK, &mask, &ts->oldmask);
+ ret = pthread_sigmask(SIG_BLOCK, &mask, &ts->oldmask);
if (ret < 0) {
WARN("Failed to block signals");
goto on_error;
ts->sigfd = signalfd(-1, &mask, SFD_CLOEXEC);
if (ts->sigfd < 0) {
WARN("Failed to create signal fd");
- sigprocmask(SIG_SETMASK, &ts->oldmask, NULL);
+ (void)pthread_sigmask(SIG_SETMASK, &ts->oldmask, NULL);
goto on_error;
}
if (ts->sigfd >= 0) {
close(ts->sigfd);
- if (sigprocmask(SIG_SETMASK, &ts->oldmask, NULL) < 0)
+ if (pthread_sigmask(SIG_SETMASK, &ts->oldmask, NULL) < 0)
WARN("%s - Failed to restore signal mask", strerror(errno));
}
#include <grp.h>
#include <inttypes.h>
#include <libgen.h>
+#include <pthread.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
if (ret < 0)
_exit(EXIT_FAILURE);
- ret = sigprocmask(SIG_UNBLOCK, &mask, NULL);
+ ret = pthread_sigmask(SIG_UNBLOCK, &mask, NULL);
if (ret < 0)
_exit(EXIT_FAILURE);