about summary refs log tree commit diff
path: root/src/signal/sigignore.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/signal/sigignore.c')
-rw-r--r--src/signal/sigignore.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/signal/sigignore.c b/src/signal/sigignore.c
new file mode 100644
index 00000000..98dff61e
--- /dev/null
+++ b/src/signal/sigignore.c
@@ -0,0 +1,12 @@
+#include <signal.h>
+#include <stdlib.h>
+
+int sigignore(int sig)
+{
+	struct sigaction sa;
+
+	sigemptyset(&sa.sa_mask);
+	sa.sa_handler = SIG_IGN;
+	sa.sa_flags = 0;
+	return sigaction(sig, &sa, NULL);
+}