WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] tools/xenstore/xenstore_core.c

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] tools/xenstore/xenstore_core.c
From: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Date: Fri, 12 Aug 2005 13:09:18 +1000
Cc: Jerone Young <jyoung5@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 12 Aug 2005 03:30:32 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <a4073d5e2f0063145b10c371a6c8fc0a@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1123794922.3043.55.camel@thinkpad> <a4073d5e2f0063145b10c371a6c8fc0a@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxx>
# 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@xxxxxxxxxxxxxxx>

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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>