xenstored: Fix socket-based connection teardown. Reading zero bytes

*should* in fact cause the connection to be destroyed. Fix this with a
little extra code in the readfd() handler.
Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kfraser@localhost.localdomain committed 2007-07-25 09:51:14 +01:00
1 parent 698543a313
commit 504e6b5eae
1 file changed
+6
+6
View File
@@ -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;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.