Merge branch 'master' into patch-1
This commit is contained in:
commit
7a570d5760
2 changed files with 18 additions and 5 deletions
4
Makefile
4
Makefile
|
@ -1,7 +1,7 @@
|
||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
|
CC ?= cc
|
||||||
output: dwmblocks.c blocks.h
|
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:
|
clean:
|
||||||
rm -f *.o *.gch dwmblocks
|
rm -f *.o *.gch dwmblocks
|
||||||
install: output
|
install: output
|
||||||
|
|
13
dwmblocks.c
13
dwmblocks.c
|
@ -13,6 +13,7 @@ typedef struct {
|
||||||
unsigned int interval;
|
unsigned int interval;
|
||||||
unsigned int signal;
|
unsigned int signal;
|
||||||
} Block;
|
} Block;
|
||||||
|
void dummysighandler(int num);
|
||||||
void sighandler(int num);
|
void sighandler(int num);
|
||||||
void getcmds(int time);
|
void getcmds(int time);
|
||||||
#ifndef __OpenBSD__
|
#ifndef __OpenBSD__
|
||||||
|
@ -79,6 +80,10 @@ void getsigcmds(int signal)
|
||||||
|
|
||||||
void setupsignals()
|
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++)
|
for(int i = 0; i < LENGTH(blocks); i++)
|
||||||
{
|
{
|
||||||
if (blocks[i].signal > 0)
|
if (blocks[i].signal > 0)
|
||||||
|
@ -137,6 +142,14 @@ void statusloop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __OpenBSD__
|
||||||
|
/* this signal handler should do nothing */
|
||||||
|
void dummysighandler(int signum)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __OpenBSD__
|
#ifndef __OpenBSD__
|
||||||
void sighandler(int signum)
|
void sighandler(int signum)
|
||||||
{
|
{
|
||||||
|
|
Reference in a new issue