summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-08-13 19:45:54 -0400
committerJakob Kaivo <jkk@ung.org>2020-08-13 19:45:54 -0400
commit834a4930e8d9b33373fbe1d636acebb87b62c2fd (patch)
treee698a9b42aff8edd73eee1a196760b15166185e2 /src
parentf20877334a6414f31a01c3ea39fabe0171efd211 (diff)
implement
Diffstat (limited to 'src')
-rw-r--r--src/signal/siginterrupt.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/signal/siginterrupt.c b/src/signal/siginterrupt.c
index 283bd65c..0c2d505a 100644
--- a/src/signal/siginterrupt.c
+++ b/src/signal/siginterrupt.c
@@ -1,8 +1,18 @@
+#include "sys/types.h"
#include <signal.h>
int siginterrupt(int sig, int flag)
{
- return 0;
+ struct sigaction sa = { 0 };
+ int ret = -1;
+
+ sigaction(sig, NULL, &sa);
+ if (flag) {
+ sa.sa_flags &= ~SA_RESTART;
+ } else {
+ sa.sa_flags |= SA_RESTART;
+ }
+ return sigaction(sig, &sa, NULL);
}
/*