# HG changeset patch # User Emmanuel Gil Peyrot # Date 1439860195 -3600 # Node ID 5e15d64a2d24e9f7c49c895e7bc95d4f96ea4d63 # Parent dec5fe6cd0d06062030a4d6b1004088e1cbe5efa If somebody closed stdin, fd could be both valid and 0, don’t check for that. diff --git a/uinput.c b/uinput.c --- a/uinput.c +++ b/uinput.c @@ -148,10 +148,8 @@ void flush_uinput(int fd){ event.type = EV_SYN; event.code = SYN_REPORT; - if(fd){ - if(write(fd, &event, sizeof(event) != sizeof(event))) - fprintf(stderr, " [%d] Flushing uinput failed\n", curdev); - } + if(write(fd, &event, sizeof(event)) != sizeof(event)) + fprintf(stderr, " [%d] Flushing uinput failed\n", curdev); }