diff options
author | torrinfail <torrinfail@gmail.com> | 2020-07-28 11:06:04 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-28 11:06:04 -0600 |
commit | 7a570d5760759329692f98b3514662cf673ea92e (patch) | |
tree | 066ab26ff3b37041707d6a0671e0f43a6db25ad2 | |
parent | e62fbe64994a8d0c38edf806f641826eb3a2b430 (diff) | |
parent | dcb198d7d7da45b8d7cd2d241b42f8405bd049b1 (diff) |
Merge branch 'master' into patch-1
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | dwmblocks.c | 19 |
2 files changed, 18 insertions, 5 deletions
@@ -1,7 +1,7 @@ PREFIX ?= /usr/local - +CC ?= cc output: dwmblocks.c blocks.h - cc dwmblocks.c `pkg-config --cflags x11` `pkg-config --libs x11` -o dwmblocks + ${CC} dwmblocks.c `pkg-config --cflags x11` `pkg-config --libs x11` -o dwmblocks clean: rm -f *.o *.gch dwmblocks install: output diff --git a/dwmblocks.c b/dwmblocks.c index 2f3b774..8668f04 100644 --- a/dwmblocks.c +++ b/dwmblocks.c @@ -13,6 +13,7 @@ typedef struct { unsigned int interval; unsigned int signal; } Block; +void dummysighandler(int num); void sighandler(int num); void getcmds(int time); #ifndef __OpenBSD__ @@ -58,7 +59,7 @@ void getcmds(int time) { const Block* current; for(int i = 0; i < LENGTH(blocks); i++) - { + { current = blocks + i; if ((current->interval != 0 && time % current->interval == 0) || time == -1) getcmd(current,statusbar[i]); @@ -79,8 +80,12 @@ void getsigcmds(int signal) void setupsignals() { + /* initialize all real time signals with dummy handler */ + for(int i = SIGRTMIN; i <= SIGRTMAX; i++) + signal(i, dummysighandler); + for(int i = 0; i < LENGTH(blocks); i++) - { + { if (blocks[i].signal > 0) signal(SIGRTMIN+blocks[i].signal, sighandler); } @@ -138,6 +143,14 @@ void statusloop() } #ifndef __OpenBSD__ +/* this signal handler should do nothing */ +void dummysighandler(int signum) +{ + return; +} +#endif + +#ifndef __OpenBSD__ void sighandler(int signum) { getsigcmds(signum-SIGRTMIN); @@ -154,7 +167,7 @@ void termhandler(int signum) int main(int argc, char** argv) { for(int i = 0; i < argc; i++) - { + { if (!strcmp("-d",argv[i])) delim = argv[++i][0]; else if(!strcmp("-p",argv[i])) |