#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->tty_info);
out_aborting:
void lxc_fini(const char *name, struct lxc_handler *handler)
{
- int i, rc;
+ int i, ret;
struct lxc_list *cur, *next;
pid_t self = lxc_raw_getpid();
char *namespaces[LXC_NS_MAX + 1];
for (i = 0; i < LXC_NS_MAX; i++) {
if (handler->nsfd[i] != -1) {
- rc = asprintf(&namespaces[namespace_count], "%s:/proc/%d/fd/%d",
+ ret = asprintf(&namespaces[namespace_count], "%s:/proc/%d/fd/%d",
ns_info[i].proc_name, self, handler->nsfd[i]);
- if (rc == -1) {
+ if (ret == -1) {
SYSERROR("Failed to allocate memory.");
break;
}
}
/* Reset mask set by setup_signal_fd. */
- if (sigprocmask(SIG_SETMASK, &handler->oldmask, NULL))
- WARN("Failed to restore signal mask.");
+ ret = pthread_sigmask(SIG_SETMASK, &handler->oldmask, NULL);
+ if (ret < 0)
+ WARN("%s - Failed to restore signal mask", strerror(errno));
lxc_console_delete(&handler->conf->console);
lxc_delete_tty(&handler->conf->tty_info);
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;