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-changelog

[Xen-changelog] [xen-unstable] Fix xenstored's dup2() usage.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Fix xenstored's dup2() usage.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 07 Sep 2007 09:14:00 -0700
Delivery-date: Fri, 07 Sep 2007 09:22:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1189157193 -3600
# Node ID 05950e909ba667b2a2326b27e68e4a1b75158355
# Parent  f779ee15c553212762780edaf105a5d68f920758
Fix xenstored's dup2() usage.

The dup2() calls had their arguments reversed. Also remove the
unnecessary close() calls.

Signed-off-by: John Levon <john.levon@xxxxxxx>
---
 tools/xenstore/xenstored_core.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -r f779ee15c553 -r 05950e909ba6 tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c   Fri Sep 07 10:18:54 2007 +0100
+++ b/tools/xenstore/xenstored_core.c   Fri Sep 07 10:26:33 2007 +0100
@@ -1878,14 +1878,14 @@ int main(int argc, char *argv[])
                fflush(stdout);
        }
 
-       /* close stdin/stdout now we're ready to accept connections */
+       /* redirect to /dev/null now we're ready to accept connections */
        if (dofork) {
                int devnull = open("/dev/null", O_RDWR);
                if (devnull == -1)
                        barf_perror("Could not open /dev/null\n");
-               close(STDIN_FILENO);  dup2(STDIN_FILENO, devnull);
-               close(STDOUT_FILENO); dup2(STDOUT_FILENO, devnull);
-               close(STDERR_FILENO); dup2(STDERR_FILENO, devnull);
+               dup2(devnull, STDIN_FILENO);
+               dup2(devnull, STDOUT_FILENO);
+               dup2(devnull, STDERR_FILENO);
                close(devnull);
                xprintf = trace;
        }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Fix xenstored's dup2() usage., Xen patchbot-unstable <=