summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-09-01 16:01:39 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-09-01 16:01:39 +0200
commit6af54f5ebd69b52e2e1c5286f8fad436f8bb93c2 (patch)
tree6fd6a68a4f847dc0410ce8f07f7e7c0614f7a007
parent6ecbff74ec1a5574b51ff3ececdcbca19f17ddcd (diff)
downloadredo-c-6af54f5ebd69b52e2e1c5286f8fad436f8bb93c2.tar.gz
redo-c-6af54f5ebd69b52e2e1c5286f8fad436f8bb93c2.tar.xz
redo-c-6af54f5ebd69b52e2e1c5286f8fad436f8bb93c2.zip
cleanup
-rw-r--r--redo.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/redo.c b/redo.c
index 978e3d1..4351479 100644
--- a/redo.c
+++ b/redo.c
@@ -459,7 +459,6 @@ run_script(char *target, int implicit)
 	char *orig_target = target;
 	int old_dep_fd = dep_fd;
 	int fd;
-	int shellwrap;
 	char *dofile;
 	pid_t pid;
 
@@ -478,8 +477,6 @@ run_script(char *target, int implicit)
 		exit(1);
 	}
 
-	shellwrap = (access (dofile, X_OK) != 0);
-
 	fd = open(dofile, O_RDONLY);
 	dprintf(dep_fd, "=%s %s\n", hashfile(fd), dofile);
 	close(fd);
@@ -515,7 +512,7 @@ djb-style default.o.do:
 		setenvfd("REDO_DEP_FD", dep_fd);
 		setenvfd("REDO_LEVEL", level + 1);
 
-		if (shellwrap)
+		if (access (dofile, X_OK) != 0)  // run -x files with /bin/sh
 			execl("/bin/sh", "/bin/sh", xflag > 0 ? "-ex" : "-e",
 			    dofile, target, basename, temp_target, (char *) 0);
 		else