ash: "Undo all redirections" comment is wrong, delete it
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 29 Jul 2017 16:54:53 +0000 (18:54 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 29 Jul 2017 16:54:53 +0000 (18:54 +0200)
No code changes.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c

index 0de81b325ca027325fba01d2cd4f292d2d315044..02b21510e5d81e920ba3505921d5ec759eb38ebf 100644 (file)
@@ -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
  *