/* See LICENSE file for copyright and license details. */
-#include <err.h>
-#include <errno.h>
#include <locale.h>
#include <signal.h>
#include <stdio.h>
char *argv0;
char buf[1024];
-static unsigned short int done;
+static int done;
static Display *dpy;
#include "config.h"
struct sigaction act;
struct timespec start, current, diff, intspec, wait;
size_t i, len;
- int sflag = 0;
+ int sflag;
char status[MAXLEN];
+ sflag = 0;
ARGBEGIN {
case 's':
sflag = 1;
sigaction(SIGTERM, &act, NULL);
if (!sflag && !(dpy = XOpenDisplay(NULL))) {
- fprintf(stderr, "slstatus: cannot open display");
+ fprintf(stderr, "Cannot open display");
return 1;
}
if (sflag) {
printf("%s\n", status);
+ fflush(stdout);
} else {
XStoreName(dpy, DefaultRootWindow(dpy), status);
XSync(dpy, False);