]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
Bash-4.2 patch 45
authorChet Ramey <chet.ramey@case.edu>
Thu, 7 Mar 2013 20:22:14 +0000 (15:22 -0500)
committerChet Ramey <chet.ramey@case.edu>
Thu, 7 Mar 2013 20:22:14 +0000 (15:22 -0500)
patchlevel.h
redir.c

index 27bb4f7f49b752f66fcd1243a7375e1528f10293..d959843504c9da050b85d70c94f832fcb4ddd38e 100644 (file)
@@ -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 f4b1658cfb936c887947e044b3f42d538bb946f2..02e477d77647b197669103b614fc024bd6e35d36 100644 (file)
--- 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