aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2013-03-07 15:22:14 -0500
committerChet Ramey <chet.ramey@case.edu>2013-03-07 15:22:14 -0500
commitf281b8f4f8936b2713966274d9f8508a9f0910e4 (patch)
tree8bc396363c39d7ff43198c12fbe1f6418df541de
parent4fd1af445d628b7191827a640b018315522f41d7 (diff)
downloadandroid_external_bash-f281b8f4f8936b2713966274d9f8508a9f0910e4.tar.gz
android_external_bash-f281b8f4f8936b2713966274d9f8508a9f0910e4.tar.bz2
android_external_bash-f281b8f4f8936b2713966274d9f8508a9f0910e4.zip
Bash-4.2 patch 45
-rw-r--r--patchlevel.h2
-rw-r--r--redir.c10
2 files changed, 11 insertions, 1 deletions
diff --git a/patchlevel.h b/patchlevel.h
index 27bb4f7..d959843 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
-#define PATCHLEVEL 44
+#define PATCHLEVEL 45
#endif /* _PATCHLEVEL_H_ */
diff --git a/redir.c b/redir.c
index f4b1658..02e477d 100644
--- a/redir.c
+++ b/redir.c
@@ -1007,6 +1007,16 @@ do_redirection_internal (redirect, flags)
close (redirector);
REDIRECTION_ERROR (r, errno, -1);
}
+ if ((flags & RX_UNDOABLE) && (ri == r_move_input || ri == r_move_output))
+ {
+ /* r_move_input and r_move_output add an additional close()
+ that needs to be undone */
+ if (fcntl (redirector, F_GETFD, 0) != -1)
+ {
+ r = add_undo_redirect (redir_fd, r_close_this, -1);
+ REDIRECTION_ERROR (r, errno, -1);
+ }
+ }
#if defined (BUFFERED_INPUT)
check_bash_input (redirector);
#endif