ia64/xen-unstable

changeset 6133:7dc610b0d1ba

Fix --output-pid (broken when we fixed --pid-file).
Thanks to Jerone Young for spotting this.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
author kaf24@firebug.cl.cam.ac.uk
date Fri Aug 12 07:21:45 2005 +0000 (2005-08-12)
parents 822566f5cfdd
children 37ee6b4b409e
files tools/xenstore/xenstored_core.c
line diff
     1.1 --- a/tools/xenstore/xenstored_core.c	Thu Aug 11 22:18:27 2005 +0000
     1.2 +++ b/tools/xenstore/xenstored_core.c	Fri Aug 12 07:21:45 2005 +0000
     1.3 @@ -1587,7 +1587,7 @@ static struct option options[] = { { "no
     1.4  
     1.5  int main(int argc, char *argv[])
     1.6  {
     1.7 -	int opt, *sock, *ro_sock, event_fd, max, tmpout;
     1.8 +	int opt, *sock, *ro_sock, event_fd, max;
     1.9  	struct sockaddr_un addr;
    1.10  	fd_set inset, outset;
    1.11  	bool dofork = true;
    1.12 @@ -1673,9 +1673,8 @@ int main(int argc, char *argv[])
    1.13  	restore_existing_connections();
    1.14  
    1.15  	if (outputpid) {
    1.16 -		char buffer[20];
    1.17 -		sprintf(buffer, "%i\n", getpid());
    1.18 -		write(tmpout, buffer, strlen(buffer));
    1.19 +		printf("%i\n", getpid());
    1.20 +		fflush(stdout);
    1.21  	}
    1.22  
    1.23  	/* close stdin/stdout now we're ready to accept connections */