diff options
author | sef <sef@FreeBSD.org> | 1997-12-06 08:01:00 +0000 |
---|---|---|
committer | sef <sef@FreeBSD.org> | 1997-12-06 08:01:00 +0000 |
commit | 999cc45d0bb2a6c96344aae5b7f89ebf021a4ada (patch) | |
tree | 56964523bab8442c65e6350008c1b3437d18e893 /usr.bin/truss | |
parent | ccf070cc8f05b0b6bcd857a1b9c75df5a28b9855 (diff) | |
download | FreeBSD-src-999cc45d0bb2a6c96344aae5b7f89ebf021a4ada.zip FreeBSD-src-999cc45d0bb2a6c96344aae5b7f89ebf021a4ada.tar.gz |
Set the close-on-exec flag in the child; otherwise, it eats up a
file descriptor that it shouldn't.
Diffstat (limited to 'usr.bin/truss')
-rw-r--r-- | usr.bin/truss/setup.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/truss/setup.c b/usr.bin/truss/setup.c index ca6692b..29cbf53 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 <stdio.h> @@ -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); |