[BusyBox-cvs] CVS update of busybox/shell (ash.c cmdedit.c)

Erik Andersen andersen at codepoet.org
Thu Aug 19 18:22:14 UTC 2004


    Date: Thursday, August 19, 2004 @ 12:22:14
  Author: andersen
    Path: /var/cvs/busybox/shell

Modified: ash.c (1.104 -> 1.105) cmdedit.c (1.92 -> 1.93)

Patch from Vladimir N. Oleynik:

On Wed Aug 18, 2004 at 06:52:57PM +0800, Matt Johnston wrote:
> I've come across some strange-seeming behaviour when running programs
> under Busybox (1.0.0-rc3) ash. If the child process sets stdin to be
> non-blocking and then exits, the parent ash will also exit. A quick strace
> shows that a subsequent read() from stdin returns EAGAIN (as would be
> expected):

Thanks!
Patch attached.


--w
vodz


Index: busybox/shell/ash.c
diff -u busybox/shell/ash.c:1.104 busybox/shell/ash.c:1.105
--- busybox/shell/ash.c:1.104	Thu Aug  5 19:49:04 2004
+++ busybox/shell/ash.c	Thu Aug 19 12:22:13 2004
@@ -6062,7 +6062,7 @@
 			}
 			goto retry;
 		}
-		if(nr < 0) {
+		if(nr < 0 && errno == 0) {
 			/* Ctrl+D presend */
 			nr = 0;
 		}
Index: busybox/shell/cmdedit.c
diff -u busybox/shell/cmdedit.c:1.92 busybox/shell/cmdedit.c:1.93
--- busybox/shell/cmdedit.c:1.92	Wed Apr 14 11:51:31 2004
+++ busybox/shell/cmdedit.c	Thu Aug 19 12:22:13 2004
@@ -1297,6 +1297,7 @@
 			/* Control-d -- Delete one character, or exit
 			 * if the len=0 and no chars to delete */
 			if (len == 0) {
+					errno = 0;
 prepare_to_die:
 #if !defined(CONFIG_ASH)
 				printf("exit");



More information about the busybox-cvs mailing list