about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2005-01-11 17:09:19 +0000
committerBart Schaefer <barts@users.sourceforge.net>2005-01-11 17:09:19 +0000
commit2bc51c9dbc6878bd5ed7e5f08554fc69a05c91eb (patch)
treed2e3727a168eaad1c64e1edd87319c030a4e7501
parent8adffbd0273114499f13e882afc5a65b134bd80f (diff)
downloadzsh-2bc51c9dbc6878bd5ed7e5f08554fc69a05c91eb.tar.gz
zsh-2bc51c9dbc6878bd5ed7e5f08554fc69a05c91eb.tar.xz
zsh-2bc51c9dbc6878bd5ed7e5f08554fc69a05c91eb.zip
20666: Avoid creating unnecessary multios when a descriptor is closed and
then re-opened.
-rw-r--r--ChangeLog7
-rw-r--r--Src/exec.c3
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 14cc39b6c..0afabb9c4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-01-11  Bart Schaefer  <schaefer@brasslantern.com>
+
+	* 20666 (tweaked): Src/exec.c: In closemn(), discard the multio
+	structure when it has only one descriptor so far, to avoid
+	creating an unnecessary multio if a later redirect re-opens that
+	descriptor.
+
 2004-01-10  Clint Adams  <clint@zsh.org>
 
 	* 20665: Completion/Unix/Command/_gnome-gv,
diff --git a/Src/exec.c b/Src/exec.c
index 53d7ff673..b5332d81a 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1487,7 +1487,8 @@ closemn(struct multio **mfds, int fd)
 		}
 	}
 	_exit(0);
-    }
+    } else if (fd >= 0)
+	mfds[fd] = NULL;
 }
 
 /* close all the mnodes (failure) */