summaryrefslogtreecommitdiff
blob: 567d82a6a6c2a927a91a13de0e6def3452df2857 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff -aburN xqf.orig/src/launch.c xqf/src/launch.c
--- xqf.orig/src/launch.c	2009-10-13 11:58:24.000000000 +0200
+++ xqf/src/launch.c	2009-10-13 11:59:35.000000000 +0200
@@ -168,13 +168,17 @@
 
   res = read (fd, cl->buffer + cl->pos, CLIENT_ERROR_BUFFER - 1 - cl->pos);
 
-  if (res <= 0) {	/* read error or EOF */
+  if (res < 0) {	/* read error or EOF */
     if (errno == EAGAIN || errno == EWOULDBLOCK)
       return;
 
     client_detach (cl);
     return;
   }
+  else if (res == 0) {
+    client_detach (cl);
+    return;
+  }
 
   if (cl->pos + res == CLIENT_ERROR_BUFFER - 1) {
     tmp = &cl->buffer[CLIENT_ERROR_BUFFER - 1];