Fixing the dup handling of the child. - nldev - NetLink DEVice manager; a lightweight netlink frontend for mdev.
       
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit d8ead95c3e98283d6d4a1c171911e91240be95cb
 (DIR) parent 4a9c648ee9a13e310901528e830755c148330518
 (HTM) Author: Christoph Lohmann <20h@r-36.net>
       Date:   Wed,  2 May 2012 21:24:00 +0200
       
       Fixing the dup handling of the child.
       
       Diffstat:
         nldev.c                             |       6 ++----
       
       1 file changed, 2 insertions(+), 4 deletions(-)
       ---
 (DIR) diff --git 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);
                                }