I have made the changes in the log.c:269 and attaching the final fix
 
 
This message posted from opensolaris.org
-------------- next part --------------
//Details of the changes made......

1. startd.c

bash-3.00# diff -u startd.c.org startd.c
--- startd.c.org        Tue Oct  2 19:45:58 2007
+++ startd.c    Sat Oct 20 16:41:36 2007
@@ -807,12 +807,12 @@
        if ((fd = open("/dev/null", O_RDONLY)) == -1) {
                uu_warn(gettext("can't connect stdin to /dev/null"));
        } else if (fd != 0) {
-               (void) dup2(fd, 0);
+               (void) dup2(fd, STDIN_FILENO);
                startd_close(fd);
        }
 
        closefrom(3);
-       (void) dup2(2, 1);
+       (void) dup2(STDERR_FILENO, STDOUT_FILENO);
 
        (void) setsid();
        (void) chdir("/");

2. fork.c
bash-3.00# diff -u fork.c.org fork.c
--- fork.c.org  Tue Oct  2 19:45:58 2007
+++ fork.c      Sun Oct 21 15:11:32 2007
@@ -265,7 +265,7 @@
                        while (dup2(fd_console, STDERR_FILENO) < 0 &&
                            errno == EINTR)
                                ;
-               if (fd_console > 2)
+               if (fd_console > STDERR_FILENO)
                        (void) close(fd_console);
        }

3. log.c
bash-3.00# diff -u log.c.org log.c
--- log.c.org   Tue Oct  2 19:45:58 2007
+++ log.c       Thu Oct 25 05:09:40 2007
@@ -263,10 +263,10 @@
        if (fd == -1)
                return;
 
-       (void) dup2(fd, 1);
-       (void) dup2(fd, 2);
+       (void) dup2(fd, STDOUT_FILENO);
+       (void) dup2(fd, STDERR_FILENO);
 
-       if (fd != 1 && fd != 2)
+       if (fd != 1 && fd != STDERR_FILENO)
                startd_close(fd);
 }


Reply via email to