mirror of
https://github.com/jjsullivan5196/wvkbd.git
synced 2025-03-14 03:12:47 +01:00
main: prevent crash on sigpipe
This is commonly caused by a bad program in the output chain, e.g. wvkbd -O | false
This commit is contained in:
parent
f74fe9a182
commit
c27f876634
6
main.c
6
main.c
@ -398,6 +398,11 @@ show(int sigint) {
|
|||||||
drwsurf_flip(&draw_surf);
|
drwsurf_flip(&draw_surf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
pipewarn(int sigint) {
|
||||||
|
fprintf(stderr, "wvkbd: cannot pipe data out.\n");
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv) {
|
main(int argc, char **argv) {
|
||||||
/* parse command line arguments */
|
/* parse command line arguments */
|
||||||
@ -530,6 +535,7 @@ main(int argc, char **argv) {
|
|||||||
|
|
||||||
signal(SIGUSR1, hide);
|
signal(SIGUSR1, hide);
|
||||||
signal(SIGUSR2, show);
|
signal(SIGUSR2, show);
|
||||||
|
signal(SIGPIPE, pipewarn);
|
||||||
|
|
||||||
while (run_display) {
|
while (run_display) {
|
||||||
while (wl_display_dispatch(display) != -1 && layer_surface) {
|
while (wl_display_dispatch(display) != -1 && layer_surface) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user