ia64/xen-unstable

changeset 15651:3ec3e2840a29

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>
author kfraser@localhost.localdomain
date Wed Jul 25 09:51:14 2007 +0100 (2007-07-25)
parents 68260372b6da
children 07655ed2fe58
files tools/xenstore/xenstored_core.c
line diff
     1.1 --- a/tools/xenstore/xenstored_core.c	Tue Jul 24 18:28:48 2007 +0100
     1.2 +++ b/tools/xenstore/xenstored_core.c	Wed Jul 25 09:51:14 2007 +0100
     1.3 @@ -1368,6 +1368,12 @@ static int readfd(struct connection *con
     1.4  			break;
     1.5  	}
     1.6  
     1.7 +	/* Reading zero length means we're done with this connection. */
     1.8 +	if ((rc == 0) && (len != 0)) {
     1.9 +		errno = EBADF;
    1.10 +		rc = -1;
    1.11 +	}
    1.12 +
    1.13  	return rc;
    1.14  }
    1.15