about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2009-09-22 16:04:13 +0000
committerWayne Davison <wayned@users.sourceforge.net>2009-09-22 16:04:13 +0000
commit2f8aaaf5e425f2285e028e35a52d0766067ab3fd (patch)
tree02b3a23ed9f9b5d6bc0521ac44e6a9fc7524e14e /Src/utils.c
parent51409732d0e647661915fde0b15323005be7c9e8 (diff)
downloadzsh-2f8aaaf5e425f2285e028e35a52d0766067ab3fd.tar.gz
zsh-2f8aaaf5e425f2285e028e35a52d0766067ab3fd.tar.xz
zsh-2f8aaaf5e425f2285e028e35a52d0766067ab3fd.zip
27286: Made movefd() return the targetfd on success. Added
a little more error checking in the callers of movefd().
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/utils.c b/Src/utils.c
index 21a7b43f6..b807eea08 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1654,14 +1654,14 @@ movefd(int fd)
 
 /*
  * Move fd x to y.  If x == -1, fd y is closed.
- * Return 0 for success, -1 for failure.
+ * Returns y for success, -1 for failure.
  */
 
 /**/
 mod_export int
 redup(int x, int y)
 {
-    int ret = 0;
+    int ret = y;
 
     if(x < 0)
 	zclose(y);