ia64/xen-unstable

changeset 8825:47013962e411

Cope with -1 eventchn_fd -- this occurs when using --no-domain-init (a
command line debugging option).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Fri Feb 10 03:23:36 2006 +0100 (2006-02-10)
parents 52b2dc7fb9b7
children 1d36cca98fc3
files tools/xenstore/xenstored_core.c
line diff
     1.1 --- a/tools/xenstore/xenstored_core.c	Fri Feb 10 02:09:19 2006 +0100
     1.2 +++ b/tools/xenstore/xenstored_core.c	Fri Feb 10 03:23:36 2006 +0100
     1.3 @@ -339,6 +339,8 @@ static int destroy_conn(void *_conn)
     1.4  
     1.5  static void set_fd(int fd, fd_set *set, int *max)
     1.6  {
     1.7 +	if (fd < 0)
     1.8 +		return;
     1.9  	FD_SET(fd, set);
    1.10  	if (fd > *max)
    1.11  		*max = fd;
    1.12 @@ -1670,7 +1672,7 @@ int main(int argc, char *argv[])
    1.13  		if (FD_ISSET(*ro_sock, &inset))
    1.14  			accept_connection(*ro_sock, false);
    1.15  
    1.16 -		if (FD_ISSET(eventchn_fd, &inset))
    1.17 +		if (eventchn_fd > 0 && FD_ISSET(eventchn_fd, &inset))
    1.18  			handle_event();
    1.19  
    1.20  		list_for_each_entry(i, &connections, list) {