summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko2017-07-29 18:54:53 +0200
committerDenys Vlasenko2017-07-29 18:54:53 +0200
commit170f93ef1bc49a9e4c68f85f5245416767c1916f (patch)
tree2aec1175c0c996cf890f84b3848544cf91a0aa1d /shell
parent008fc9499ae63186589fbc81a5f849a2df652004 (diff)
downloadbusybox-170f93ef1bc49a9e4c68f85f5245416767c1916f.zip
busybox-170f93ef1bc49a9e4c68f85f5245416767c1916f.tar.gz
ash: "Undo all redirections" comment is wrong, delete it
No code changes. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c48
1 files changed, 22 insertions, 26 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 0de81b3..02b2151 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -5558,6 +5558,28 @@ redirect(union node *redir, int flags)
preverrout_fd = copied_fd2;
}
+static int
+redirectsafe(union node *redir, int flags)
+{
+ int err;
+ volatile int saveint;
+ struct jmploc *volatile savehandler = exception_handler;
+ struct jmploc jmploc;
+
+ SAVE_INT(saveint);
+ /* "echo 9>/dev/null; echo >&9; echo result: $?" - result should be 1, not 2! */
+ err = setjmp(jmploc.loc); // huh?? was = setjmp(jmploc.loc) * 2;
+ if (!err) {
+ exception_handler = &jmploc;
+ redirect(redir, flags);
+ }
+ exception_handler = savehandler;
+ if (err && exception_type != EXERROR)
+ longjmp(exception_handler->loc, 1);
+ RESTORE_INT(saveint);
+ return err;
+}
+
/*
* Undo the effects of the last redirection.
*/
@@ -5593,32 +5615,6 @@ popredir(int drop, int restore)
INT_ON;
}
-/*
- * Undo all redirections. Called on error or interrupt.
- */
-
-static int
-redirectsafe(union node *redir, int flags)
-{
- int err;
- volatile int saveint;
- struct jmploc *volatile savehandler = exception_handler;
- struct jmploc jmploc;
-
- SAVE_INT(saveint);
- /* "echo 9>/dev/null; echo >&9; echo result: $?" - result should be 1, not 2! */
- err = setjmp(jmploc.loc); // huh?? was = setjmp(jmploc.loc) * 2;
- if (!err) {
- exception_handler = &jmploc;
- redirect(redir, flags);
- }
- exception_handler = savehandler;
- if (err && exception_type != EXERROR)
- longjmp(exception_handler->loc, 1);
- RESTORE_INT(saveint);
- return err;
-}
-
/* ============ Routines to expand arguments to commands
*