summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch')
-rw-r--r--patch/include.c4
-rw-r--r--patch/include.h4
-rw-r--r--patch/restartsig.c15
-rw-r--r--patch/restartsig.h2
4 files changed, 25 insertions, 0 deletions
diff --git a/patch/include.c b/patch/include.c
index bb41382..920f7ff 100644
--- a/patch/include.c
+++ b/patch/include.c
@@ -54,6 +54,10 @@
#include "push.c"
#endif
+#if RESTARTSIG_PATCH
+#include "restartsig.c"
+#endif
+
#if ROTATESTACK_PATCH
#include "rotatestack.c"
#endif
diff --git a/patch/include.h b/patch/include.h
index d19423e..67578c7 100644
--- a/patch/include.h
+++ b/patch/include.h
@@ -54,6 +54,10 @@
#include "push.h"
#endif
+#if RESTARTSIG_PATCH
+#include "restartsig.h"
+#endif
+
#if ROTATESTACK_PATCH
#include "rotatestack.h"
#endif
diff --git a/patch/restartsig.c b/patch/restartsig.c
new file mode 100644
index 0000000..0bef576
--- /dev/null
+++ b/patch/restartsig.c
@@ -0,0 +1,15 @@
+static int restart = 0;
+
+void
+sighup(int unused)
+{
+ Arg a = {.i = 1};
+ quit(&a);
+}
+
+void
+sigterm(int unused)
+{
+ Arg a = {.i = 0};
+ quit(&a);
+} \ No newline at end of file
diff --git a/patch/restartsig.h b/patch/restartsig.h
new file mode 100644
index 0000000..5a08c39
--- /dev/null
+++ b/patch/restartsig.h
@@ -0,0 +1,2 @@
+static void sighup(int unused);
+static void sigterm(int unused); \ No newline at end of file