Clean up dwmblocks-pulse-listener.c
This commit is contained in:
parent
b0441e32af
commit
502f596c87
@ -7,6 +7,14 @@
|
|||||||
|
|
||||||
#define ERROR(...) fprintf(stderr, "error: " __VA_ARGS__)
|
#define ERROR(...) fprintf(stderr, "error: " __VA_ARGS__)
|
||||||
|
|
||||||
|
#ifdef __OpenBSD__
|
||||||
|
#define SIGMAX (SIGUSR2 - 1)
|
||||||
|
#define SIGMIN (SIGUSR1 - 1)
|
||||||
|
#else
|
||||||
|
#define SIGMAX SIGRTMAX
|
||||||
|
#define SIGMIN SIGRTMIN
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
size_t pid;
|
size_t pid;
|
||||||
unsigned int signum;
|
unsigned int signum;
|
||||||
@ -79,15 +87,15 @@ int main(int argc, const char **argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
char *endptr = NULL;
|
char *endptr = NULL;
|
||||||
unsigned int signum = SIGRTMIN + 1;
|
unsigned int signum = SIGMIN + 1;
|
||||||
if (argc >= 3 && argv[1][0] == '-') {
|
if (argc >= 3 && argv[1][0] == '-') {
|
||||||
const char *signumstr = argv[1] + 1;
|
const char *signumstr = argv[1] + 1;
|
||||||
unsigned long num = strtoul(signumstr, &endptr, 10);
|
unsigned long num = strtoul(signumstr, &endptr, 10);
|
||||||
if (num > (SIGRTMAX - SIGRTMIN) + 1) {
|
if (num > SIGMAX - SIGMIN) {
|
||||||
ERROR("signal out of range: %lu\n", num);
|
ERROR("signal out of range: %lu\n", num);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
signum = SIGRTMIN + num;
|
signum = SIGMIN + num;
|
||||||
++argv;
|
++argv;
|
||||||
}
|
}
|
||||||
endptr = NULL;
|
endptr = NULL;
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
#include<X11/Xlib.h>
|
#include<X11/Xlib.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef __OpenBSD__
|
#ifdef __OpenBSD__
|
||||||
#define SIGPLUS SIGUSR1+1
|
#define SIGPLUS (SIGUSR1 + 1)
|
||||||
#define SIGMINUS SIGUSR1-1
|
#define SIGMINUS (SIGUSR1 - 1)
|
||||||
#else
|
#else
|
||||||
#define SIGPLUS SIGRTMIN
|
#define SIGPLUS SIGRTMIN
|
||||||
#define SIGMINUS SIGRTMIN
|
#define SIGMINUS SIGRTMIN
|
||||||
|
Loading…
Reference in New Issue
Block a user