diff uinput.c @ 9:5e15d64a2d24 default tip

If somebody closed stdin, fd could be both valid and 0, don’t check for that.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 18 Aug 2015 02:09:55 +0100
parents dec5fe6cd0d0
children
line wrap: on
line diff
--- 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);
 }