/* See LICENSE file for copyright and license details. */
-
#include <dirent.h>
#include <err.h>
#include <fcntl.h>
const char *args;
};
-static const char *bprintf(const char *fmt, ...);
static const char *battery_perc(const char *bat);
static const char *battery_power(const char *bat);
static const char *battery_state(const char *bat);
static const char *vol_perc(const char *card);
static const char *wifi_perc(const char *iface);
static const char *wifi_essid(const char *iface);
-static void sighandler(const int signo);
-static void usage(void);
char *argv0;
static unsigned short int delay = 0;
}
static void
-sighandler(const int signo)
+terminate(const int signo)
{
- if (signo == SIGTERM || signo == SIGINT) {
- done = 1;
- }
+ done = 1;
}
static void
}
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);