aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2012-05-02 21:24:00 +0200
committerChristoph Lohmann <20h@r-36.net>2012-05-02 21:24:00 +0200
commitd8ead95c3e98283d6d4a1c171911e91240be95cb (patch)
tree44c94d50df9f81ab9d1e1112d725c89de569d7a3
parent4a9c648ee9a13e310901528e830755c148330518 (diff)
downloadnldev-d8ead95c3e98283d6d4a1c171911e91240be95cb.tar.bz2
nldev-d8ead95c3e98283d6d4a1c171911e91240be95cb.tar.xz
Fixing the dup handling of the child.
-rw-r--r--nldev.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/nldev.c b/nldev.c
index 1588ccc..296de4d 100644
--- a/nldev.c
+++ b/nldev.c
@@ -95,10 +95,8 @@ child(char *runpath)
if (dofork && !dodebug) {
fd = open("/dev/null", O_RDWR);
if (fd >= 0) {
- if (write(0, 0, 0) < 0)
- dup2(fd, 0);
- if (write(2, 0, 0) < 0)
- dup2(fd, 2);
+ dup2(fd, 1);
+ dup2(fd, 2);
if (fd > 2)
close(fd);
}