force line-buffered stdout if stdout is not a tty

This commit is contained in:
Dima Krasner 2022-07-19 20:12:03 +03:00
parent e98719f552
commit 296ae396dc

4
dwl.c
View File

@ -1670,7 +1670,6 @@ printstatus(void)
sel, urg);
printf("%s layout %s\n", m->wlr_output->name, m->lt[m->sellt]->symbol);
}
fflush(stdout);
}
void
@ -1939,6 +1938,9 @@ setsel(struct wl_listener *listener, void *data)
void
setup(void)
{
/* Force line-buffered stdout */
setvbuf(stdout, NULL, _IOLBF, 0);
/* The Wayland display is managed by libwayland. It handles accepting
* clients from the Unix socket, manging Wayland globals, and so on. */
dpy = wl_display_create();