sinit

suckless init
git clone git://git.2f30.org/sinit
Log | Files | Refs | README | LICENSE

commit 7345487258eacdabbb6a6335ab71e3c41ca79a3d
parent 88d185e42ba5e7e4eed1393c1042aede529d13ce
Author: sin <sin@2f30.org>
Date:   Sun,  9 Feb 2014 12:43:18 +0000

Simplify naming of variables

Diffstat:
Msinit.c | 22+++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/sinit.c b/sinit.c @@ -31,9 +31,9 @@ static Sigmap dispatchsig[] = { int main(void) { - struct signalfd_siginfo siginfo; - sigset_t sigset; - int sigfd; + struct signalfd_siginfo si; + sigset_t set; + int fd; int i; ssize_t n; @@ -41,30 +41,30 @@ main(void) return EXIT_FAILURE; setsid(); - if (sigemptyset(&sigset) < 0) + if (sigemptyset(&set) < 0) eprintf("sinit: sigemptyset:"); for (i = 0; i < LEN(dispatchsig); i++) - if (sigaddset(&sigset, dispatchsig[i].sig) < 0) + if (sigaddset(&set, dispatchsig[i].sig) < 0) eprintf("sinit: sigaddset:"); - if (sigprocmask(SIG_BLOCK, &sigset, NULL) < 0) + if (sigprocmask(SIG_BLOCK, &set, NULL) < 0) eprintf("sinit: sigprocmask:"); - sigfd = signalfd(-1, &sigset, SFD_CLOEXEC); - if (sigfd < 0) + fd = signalfd(-1, &set, SFD_CLOEXEC); + if (fd < 0) eprintf("sinit: signalfd:"); spawn(rcinitcmd); while (1) { - n = read(sigfd, &siginfo, sizeof(siginfo)); + n = read(fd, &si, sizeof(si)); if (n < 0) eprintf("sinit: read:"); - if (n != sizeof(siginfo)) + if (n != sizeof(si)) continue; for (i = 0; i < LEN(dispatchsig); i++) - if (dispatchsig[i].sig == siginfo.ssi_signo) + if (dispatchsig[i].sig == si.ssi_signo) dispatchsig[i].func(); }