changeset 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
files uinput.c
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
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);
 }