about summary refs log tree commit diff
path: root/nq.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-07-31 15:43:52 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-07-31 15:43:52 +0200
commit240b5027e10ab46ae540f3e47f659f731f7401c4 (patch)
tree1c5a267b80618489ea239f65384bad1904a2d0b2 /nq.c
parentd56cbed0ccbf9cce65f981a2ac1ddb0fa0d1629e (diff)
downloadnq-240b5027e10ab46ae540f3e47f659f731f7401c4.tar.gz
nq-240b5027e10ab46ae540f3e47f659f731f7401c4.tar.xz
nq-240b5027e10ab46ae540f3e47f659f731f7401c4.zip
close stdin/stdout, else it locks e.g. for "nq ... | cat"
Diffstat (limited to 'nq.c')
-rw-r--r--nq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/nq.c b/nq.c
index 7400933..69d478c 100644
--- a/nq.c
+++ b/nq.c
@@ -107,6 +107,8 @@ main(int argc, char *argv[])
 		/* output expected lockfile name.  */
 		sprintf(lockfile, ",%011lx.%d", ms, child);
 		dprintf(1, "%s\n", lockfile);
+		close(0);
+		close(1);
 
 		/* signal parent to exit.  */
 		close(pipefd[1]);