diff options
author | Marvin Steadfast <marvin@xsteadfastx.org> | 2019-03-21 13:36:50 +0100 |
---|---|---|
committer | prspkt <prspkt@protonmail.com> | 2019-03-24 15:57:41 +0200 |
commit | 73785b1b278d16030dfc32f17c412e966e3c973f (patch) | |
tree | 6e6cc0b1b3860ac3d1c04a82ea86d37a665e61c3 /testing/i3blocks/fix-musl.patch | |
parent | 15aca31a287c4aa09488ecf02cbff141e32eca80 (diff) |
testing/i3blocks: new aport
Diffstat (limited to 'testing/i3blocks/fix-musl.patch')
-rw-r--r-- | testing/i3blocks/fix-musl.patch | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/testing/i3blocks/fix-musl.patch b/testing/i3blocks/fix-musl.patch new file mode 100644 index 00000000000..28d5af9df32 --- /dev/null +++ b/testing/i3blocks/fix-musl.patch @@ -0,0 +1,79 @@ +From 28c2b092f7d41aa723dad18b0484dca0da1cbbf5 Mon Sep 17 00:00:00 2001 +From: Leorize <alaviss@users.noreply.github.com> +Date: Wed, 5 Jul 2017 11:07:07 +0700 +Subject: [PATCH] sched: fix musl libc build + +This commit solves the following error when building with musl libc +``` +src/sched.c:34:17: error: 'sigset' redeclared as different kind of symbol + static sigset_t sigset; + ^~~~~~ +In file included from src/sched.c:21:0: +/usr/include/signal.h:231:8: note: previous declaration of 'sigset' was here + void (*sigset(int, void (*)(int)))(int); + ^~~~~~ +make: *** [<builtin>: src/sched.o] Error 1 +make: *** Waiting for unfinished jobs.... +``` + +Based on the patch by @E100Beta +--- + src/sched.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/sched.c b/src/sched.c +index d1c4634..dabdeef 100644 +--- a/src/sched.c ++++ b/src/sched.c +@@ -31,7 +31,7 @@ + #include "json.h" + #include "log.h" + +-static sigset_t sigset; ++static sigset_t set; + + static int + gcd(int a, int b) +@@ -88,13 +88,13 @@ setup_timer(struct bar *bar) + static int + setup_signals(void) + { +- if (sigemptyset(&sigset) == -1) { ++ if (sigemptyset(&set) == -1) { + errorx("sigemptyset"); + return 1; + } + + #define ADD_SIG(_sig) \ +- if (sigaddset(&sigset, _sig) == -1) { errorx("sigaddset(%d)", _sig); return 1; } ++ if (sigaddset(&set, _sig) == -1) { errorx("sigaddset(%d)", _sig); return 1; } + + /* Control signals */ + ADD_SIG(SIGTERM); +@@ -125,7 +125,7 @@ setup_signals(void) + #undef ADD_SIG + + /* Block signals for which we are interested in waiting */ +- if (sigprocmask(SIG_SETMASK, &sigset, NULL) == -1) { ++ if (sigprocmask(SIG_SETMASK, &set, NULL) == -1) { + errorx("sigprocmask"); + return 1; + } +@@ -164,7 +164,7 @@ sched_start(struct bar *bar) + bar_poll_timed(bar); + + while (1) { +- sig = sigwaitinfo(&sigset, &siginfo); ++ sig = sigwaitinfo(&set, &siginfo); + if (sig == -1) { + /* Hiding the bar may interrupt this system call */ + if (errno == EINTR) +@@ -212,7 +212,7 @@ sched_start(struct bar *bar) + * Unblock signals (so subsequent syscall can be interrupted) + * and wait for child processes termination. + */ +- if (sigprocmask(SIG_UNBLOCK, &sigset, NULL) == -1) ++ if (sigprocmask(SIG_UNBLOCK, &set, NULL) == -1) + errorx("sigprocmask"); + while (waitpid(-1, NULL, 0) > 0) + continue; |