summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Schleifer <js@heap.zone>2017-08-01 15:55:45 +0200
committerJonathan Schleifer <js@heap.zone>2017-08-01 15:56:22 +0200
commitdc519bcb9e545e052312485bb1acd7bf1b67a8f2 (patch)
treea53c1b3137c8bdc58a1c22bc921e79b084df0289
parentc11b0b3965fd3037b4e1fa268154c5dc01b92a9b (diff)
OFApplication: Don't use SA_RESTART0.90-release
This way, the behavior is consistent, independent of whether sigaction() is available or not.
-rw-r--r--configure.ac2
-rw-r--r--src/OFApplication.m26
2 files changed, 1 insertions, 27 deletions
diff --git a/configure.ac b/configure.ac
index 51f3825a..a561442d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -656,8 +656,6 @@ AS_IF([test x"$ENCODINGS_SRCS" != x""], [
])
])
-AC_CHECK_FUNCS(sigaction)
-
AC_CHECK_FUNCS(arc4random random, break)
AC_CHECK_LIB(dl, dlopen, LIBS="$LIBS -ldl")
diff --git a/src/OFApplication.m b/src/OFApplication.m
index 6ee5fc91..2def1365 100644
--- a/src/OFApplication.m
+++ b/src/OFApplication.m
@@ -71,12 +71,6 @@ extern char **environ;
# undef asm
#endif
-#ifdef HAVE_SIGACTION
-# ifndef SA_RESTART
-# define SA_RESTART 0
-# endif
-#endif
-
@interface OFApplication ()
- (instancetype)of_init OF_METHOD_FAMILY(init);
- (void)of_setArgumentCount: (int *)argc
@@ -509,24 +503,7 @@ of_application_main(int *argc, char **argv[], Class cls)
- (void)setDelegate: (id <OFApplicationDelegate>)delegate
{
-#ifdef HAVE_SIGACTION
- struct sigaction sa = { .sa_flags = SA_RESTART };
- sigemptyset(&sa.sa_mask);
-
-# define REGISTER_SIGNAL(sig) \
- if ([delegate respondsToSelector: \
- @selector(applicationDidReceive##sig)]) { \
- _##sig##Handler = (void (*)(id, SEL))[(id)delegate \
- methodForSelector: \
- @selector(applicationDidReceive##sig)]; \
- \
- sa.sa_handler = handle##sig; \
- } else \
- sa.sa_handler = SIG_DFL; \
- \
- OF_ENSURE(sigaction(sig, &sa, NULL) == 0);
-#else
-# define REGISTER_SIGNAL(sig) \
+#define REGISTER_SIGNAL(sig) \
if ([delegate respondsToSelector: \
@selector(applicationDidReceive##sig)]) { \
_##sig##Handler = (void (*)(id, SEL))[(id)delegate \
@@ -535,7 +512,6 @@ of_application_main(int *argc, char **argv[], Class cls)
signal(sig, handle##sig); \
} else \
signal(sig, (void (*)(int))SIG_DFL);
-#endif
_delegate = delegate;