diff options
| author | Laslo Hunhold <dev@frign.de> | 2017-08-13 20:33:44 +0200 |
|---|---|---|
| committer | Aaron Marcher <me@drkhsh.at> | 2017-08-13 23:32:14 +0200 |
| commit | 3468a6e368974ea222ab81c389e0800748541c42 (patch) | |
| tree | 8805d09e26ad5add756006c4925eb308cb2aa6aa | |
| parent | 450e8e6e6b3fd83db85ccbcc96d5d78aa71c6fd9 (diff) | |
| download | slstatus-3468a6e368974ea222ab81c389e0800748541c42.tar.gz | |
Simplify signal handling a bit
| -rw-r--r-- | slstatus.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -837,11 +837,9 @@ wifi_essid(const char *iface) } static void -sighandler(const int signo) +terminate(const int signo) { - if (signo == SIGTERM || signo == SIGINT) { - done = 1; - } + done = 1; } static void @@ -874,9 +872,9 @@ main(int argc, char *argv[]) } memset(&act, 0, sizeof(act)); - act.sa_handler = sighandler; - sigaction(SIGINT, &act, 0); - sigaction(SIGTERM, &act, 0); + act.sa_handler = terminate; + sigaction(SIGINT, &act, NULL); + sigaction(SIGTERM, &act, NULL); if (!sflag) { dpy = XOpenDisplay(NULL); |
