[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] xenstored: Fix socket-based connection teardown. Reading zero bytes
# HG changeset patch # User kfraser@xxxxxxxxxxxxxxxxxxxxx # Date 1185353474 -3600 # Node ID 3ec3e2840a29bb6d4c64b8094248381712370f17 # Parent 68260372b6da5dfb0e32dfe26cc4a8ddbf0b3df0 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@xxxxxxxxxxxxx> --- tools/xenstore/xenstored_core.c | 6 ++++++ 1 files changed, 6 insertions(+) diff -r 68260372b6da -r 3ec3e2840a29 tools/xenstore/xenstored_core.c --- a/tools/xenstore/xenstored_core.c Tue Jul 24 18:28:48 2007 +0100 +++ b/tools/xenstore/xenstored_core.c Wed Jul 25 09:51:14 2007 +0100 @@ -1366,6 +1366,12 @@ static int readfd(struct connection *con } if (errno != EINTR) break; + } + + /* Reading zero length means we're done with this connection. */ + if ((rc == 0) && (len != 0)) { + errno = EBADF; + rc = -1; } return rc; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |