From 26b4d5d1677b43ed7dd1b26cd20919939933c042 Mon Sep 17 00:00:00 2001 From: sef Date: Sat, 6 Dec 1997 08:01:00 +0000 Subject: [PATCH] Set the close-on-exec flag in the child; otherwise, it eats up a file descriptor that it shouldn't. --- usr.bin/truss/setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/truss/setup.c b/usr.bin/truss/setup.c index ca6692b37eef..29cbf53d05a2 100644 --- a/usr.bin/truss/setup.c +++ b/usr.bin/truss/setup.c @@ -3,7 +3,7 @@ * I'm afraid. */ /* - * $Id$ + * $Id: setup.c,v 1.1 1997/12/06 05:23:05 sef Exp $ */ #include @@ -46,6 +46,7 @@ setup_and_wait(char *command[]) { fd = open("/proc/curproc/mem", O_WRONLY); if (fd == -1) err(2, "cannot open /proc/curproc/mem: %s\n", strerror(errno)); + fcntl(fd, F_SETFD, 1); if (ioctl(fd, PIOCBIS, &mask) == -1) err(3, "PIOCBIS: %s\n", strerror(errno)); execvp(command[0], command);