File mouseemu.write_error.patch of Package mouseemu

#! /bin/sh /usr/share/dpatch/dpatch-run
## write_error.dpatch by <agx@sigxcpu.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix write error detection
##
@DPATCH@

---
 mouseemu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mouseemu.c
+++ b/mouseemu.c
@@ -95,7 +95,7 @@ static void send_event(int fd, int type,
 
 static void passthrough(int fd, struct input_event event)
 {
-	if (write(fd, &event, sizeof(event)) < sizeof(event))
+	if (write(fd, &event, sizeof(event)) <= 0)
 		perror("passthrough error");
 
 }