aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/xenstore/xenstored_core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 1081103459..f34a698cb4 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1368,6 +1368,12 @@ static int readfd(struct connection *conn, void *data, unsigned int len)
break;
}
+ /* Reading zero length means we're done with this connection. */
+ if ((rc == 0) && (len != 0)) {
+ errno = EBADF;
+ rc = -1;
+ }
+
return rc;
}