summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-09-06 20:47:45 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-09-06 20:47:45 +0200
commit12058892aa7a70227a9fefde0eebfaba92943912 (patch)
tree357ee9ddbfb00544e4c391979f01155858660f93
parent9317704719ca93d15cf1a26d08e2e767ee3b0c93 (diff)
downloadredo-c-12058892aa7a70227a9fefde0eebfaba92943912.tar.gz
redo-c-12058892aa7a70227a9fefde0eebfaba92943912.tar.xz
redo-c-12058892aa7a70227a9fefde0eebfaba92943912.zip
Avoid close(-1) on toplevel redo.
-rw-r--r--redo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/redo.c b/redo.c
index 446b810..f9fa518 100644
--- a/redo.c
+++ b/redo.c
@@ -621,7 +621,8 @@ djb-style default.o.do:
 			basename[i--] = 0;
 		}
 
-		close(old_dep_fd);
+		if (old_dep_fd > 0)
+			close(old_dep_fd);
 		setenvfd("REDO_DEP_FD", dep_fd);
 		setenvfd("REDO_LEVEL", level + 1);
 		if (sflag > 0)