Renamed few variables
This commit is contained in:
parent
b7afa41264
commit
b43e93b418
24
dwmblocks.c
24
dwmblocks.c
|
@ -27,14 +27,14 @@ typedef struct {
|
||||||
|
|
||||||
#include "blocks.h"
|
#include "blocks.h"
|
||||||
|
|
||||||
static void buttonhandler(int signal, siginfo_t *si, void *ucontext);
|
static void buttonhandler(int sig, siginfo_t *info, void *ucontext);
|
||||||
static void cleanup();
|
static void cleanup();
|
||||||
static void getcmd(Block *block, int sigval);
|
static void getcmd(Block *block, int sigval);
|
||||||
static void setroot();
|
static void setroot();
|
||||||
static void setupsignals();
|
static void setupsignals();
|
||||||
static void sighandler(int signal, siginfo_t *si, void *ucontext);
|
static void sighandler(int sig, siginfo_t *si, void *ucontext);
|
||||||
static void statusloop();
|
static void statusloop();
|
||||||
static void termhandler(int signum);
|
static void termhandler(int sig);
|
||||||
static int updatestatus();
|
static int updatestatus();
|
||||||
static void writepid();
|
static void writepid();
|
||||||
|
|
||||||
|
@ -45,18 +45,18 @@ static Display *dpy;
|
||||||
static sigset_t blocksigmask;
|
static sigset_t blocksigmask;
|
||||||
|
|
||||||
void
|
void
|
||||||
buttonhandler(int signal, siginfo_t *si, void *ucontext)
|
buttonhandler(int sig, siginfo_t *info, void *ucontext)
|
||||||
{
|
{
|
||||||
signal = si->si_value.sival_int >> 8;
|
sig = info->si_value.sival_int >> 8;
|
||||||
for (Block *block = blocks; block->pathu; block++)
|
for (Block *block = blocks; block->pathu; block++)
|
||||||
if (block->signal == signal)
|
if (block->signal == sig)
|
||||||
switch (fork()) {
|
switch (fork()) {
|
||||||
case -1:
|
case -1:
|
||||||
perror("buttonhandler - fork");
|
perror("buttonhandler - fork");
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
char button[] = { '0' + (si->si_value.sival_int & 0xff), '\0' };
|
char button[] = { '0' + (info->si_value.sival_int & 0xff), '\0' };
|
||||||
char *arg[] = { block->pathc, button, NULL };
|
char *arg[] = { block->pathc, button, NULL };
|
||||||
|
|
||||||
close(ConnectionNumber(dpy));
|
close(ConnectionNumber(dpy));
|
||||||
|
@ -183,12 +183,12 @@ setupsignals()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
sighandler(int signal, siginfo_t *si, void *ucontext)
|
sighandler(int sig, siginfo_t *info, void *ucontext)
|
||||||
{
|
{
|
||||||
signal -= SIGRTMIN;
|
sig -= SIGRTMIN;
|
||||||
for (Block *block = blocks; block->pathu; block++)
|
for (Block *block = blocks; block->pathu; block++)
|
||||||
if (block->signal == signal)
|
if (block->signal == sig)
|
||||||
getcmd(block, si->si_value.sival_int);
|
getcmd(block, info->si_value.sival_int);
|
||||||
setroot();
|
setroot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ statusloop()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
termhandler(int signum)
|
termhandler(int sig)
|
||||||
{
|
{
|
||||||
cleanup();
|
cleanup();
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
Loading…
Reference in a new issue