bug in busybox BUSYBOX_1_1_0_pre1

Max Okumoto max at kiyon.com
Tue Dec 13 05:00:39 UTC 2005


 I ran into a problem with getty.
 If the getty is exec'ed with stdin fd closed the dup2()
 causes problems on my platform.  The /bin/init is not
 busybox.  And here is my quick patch to get around the
 problem.
 
                                 Max
 
 
 CS file: /opt/cvs/busybox/loginutils/getty.c,v
 retrieving revision 1.1.1.1
 retrieving revision 1.2
 diff -r1.1.1.1 -r1.2
 533,535c533,537
 <               if (dup2(fd, STDIN_FILENO) == -1)
 <                       error("/dev/%s: cannot open as standard input: %m", tty);
 <               close(fd);
 ---
 >               if (fd != STDIN_FILENO) {
 >                       if (dup2(fd, STDIN_FILENO) == -1)
 >                               error("/dev/%s: cannot open as standard input: %m", tty);
 >                       close(fd);
 >               }
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20051212/5707b268/attachment-0001.htm 


More information about the busybox mailing list