mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
1 parent
698543a313
commit
504e6b5eae
1 file changed
+6
@@ -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;
|
||||
}
|
||||
|
||||
|
||||