From: Chet Ramey Date: Thu, 7 Mar 2013 20:22:14 +0000 (-0500) Subject: Bash-4.2 patch 45 X-Git-Tag: bash-4.3~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f281b8f4f8936b2713966274d9f8508a9f0910e4;p=thirdparty%2Fbash.git Bash-4.2 patch 45 --- diff --git a/patchlevel.h b/patchlevel.h index 27bb4f7f4..d95984350 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 f4b1658cf..02e477d77 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