All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/xenstore/xenstore_core.c
@ 2005-08-11 21:15 Jerone Young
  2005-08-11 22:02 ` Keir Fraser
  0 siblings, 1 reply; 3+ messages in thread
From: Jerone Young @ 2005-08-11 21:15 UTC (permalink / raw)
  To: xen-devel

tmpout is initialized. Just print to the screen.

Signed-off-by: Jerone Young <jyoung5@us.ibm.com>

--- tools/xenstore/xenstored_core.old   2005-08-11 12:54:42.000000000
-0500
+++ tools/xenstore/xenstored_core.c     2005-08-11 12:55:16.000000000
-0500
@@ -1675,7 +1675,7 @@ int main(int argc, char *argv[])
        if (outputpid) {
                char buffer[20];
                sprintf(buffer, "%i\n", getpid());
-               write(tmpout, buffer, strlen(buffer));
+               printf("%i\n", buffer);
        }

        /* close stdin/stdout now we're ready to accept connections */




-- 
Jerone Young
IBM Linux Technology Center
jyoung5@us.ibm.com
512-838-1157 (T/L: 678-1157)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools/xenstore/xenstore_core.c
  2005-08-11 21:15 [PATCH] tools/xenstore/xenstore_core.c Jerone Young
@ 2005-08-11 22:02 ` Keir Fraser
  2005-08-12  3:09   ` Rusty Russell
  0 siblings, 1 reply; 3+ messages in thread
From: Keir Fraser @ 2005-08-11 22:02 UTC (permalink / raw)
  To: Jerone Young, Rusty Russell; +Cc: xen-devel


This one's a bug, but I don't think that's the right fix. Rusty?

  -- Keir

On 11 Aug 2005, at 22:15, Jerone Young wrote:

> tmpout is initialized. Just print to the screen.
>
> Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
>
> --- tools/xenstore/xenstored_core.old   2005-08-11 12:54:42.000000000
> -0500
> +++ tools/xenstore/xenstored_core.c     2005-08-11 12:55:16.000000000
> -0500
> @@ -1675,7 +1675,7 @@ int main(int argc, char *argv[])
>         if (outputpid) {
>                 char buffer[20];
>                 sprintf(buffer, "%i\n", getpid());
> -               write(tmpout, buffer, strlen(buffer));
> +               printf("%i\n", buffer);
>         }
>
>         /* close stdin/stdout now we're ready to accept connections */
>
>
>
>
> -- 
> Jerone Young
> IBM Linux Technology Center
> jyoung5@us.ibm.com
> 512-838-1157 (T/L: 678-1157)
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools/xenstore/xenstore_core.c
  2005-08-11 22:02 ` Keir Fraser
@ 2005-08-12  3:09   ` Rusty Russell
  0 siblings, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2005-08-12  3:09 UTC (permalink / raw)
  To: Keir Fraser; +Cc: Jerone Young, xen-devel

On Thu, 2005-08-11 at 23:02 +0100, Keir Fraser wrote:
> This one's a bug, but I don't think that's the right fix. Rusty?

Yeah, we used to close stdout earlier, so this used a temporary dup'ed
fd.  It's now much simpler: nice spotting Jerone.

Rusty.

# HG changeset patch
# User Rusty Russell <rusty@rustcorp.com.au>
# Node ID 1f532dacdc4870c235d57c55b2f6051b9ee40419
# Parent  822566f5cfddce3b641b5a1a119dfd592ec69158
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>

diff -r 822566f5cfdd -r 1f532dacdc48 tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c	Thu Aug 11 22:18:27 2005
+++ b/tools/xenstore/xenstored_core.c	Fri Aug 12 03:08:56 2005
@@ -1587,7 +1587,7 @@
 
 int main(int argc, char *argv[])
 {
-	int opt, *sock, *ro_sock, event_fd, max, tmpout;
+	int opt, *sock, *ro_sock, event_fd, max;
 	struct sockaddr_un addr;
 	fd_set inset, outset;
 	bool dofork = true;
@@ -1673,9 +1673,8 @@
 	restore_existing_connections();
 
 	if (outputpid) {
-		char buffer[20];
-		sprintf(buffer, "%i\n", getpid());
-		write(tmpout, buffer, strlen(buffer));
+		printf("%i\n", getpid());
+		fflush(stdout);
 	}
 
 	/* close stdin/stdout now we're ready to accept connections */

-- 
A bad analogy is like a leaky screwdriver -- Richard Braakman

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-08-12  3:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-11 21:15 [PATCH] tools/xenstore/xenstore_core.c Jerone Young
2005-08-11 22:02 ` Keir Fraser
2005-08-12  3:09   ` Rusty Russell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.