aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/script
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2016-03-08 18:05:02 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2016-03-08 18:05:02 +0000
commit7b245cb846ca18c501059c5875a90792baf5821b (patch)
tree1af6dc38e793b77f7419ffce8ee679ccc8140b33 /usr.bin/script
parent26802705d31aee2e827897d68319482f1340d759 (diff)
Notes
Diffstat (limited to 'usr.bin/script')
-rw-r--r--usr.bin/script/script.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c
index 72814fbe17ad..49446ef730ab 100644
--- a/usr.bin/script/script.c
+++ b/usr.bin/script/script.c
@@ -224,13 +224,19 @@ main(int argc, char *argv[])
warn("fork");
done(1);
}
- if (child == 0)
+ if (child == 0) {
+ if (fflg) {
+ int pid;
+
+ pid = getpid();
+ if (ioctl(fm_fd, FILEMON_SET_PID, &pid) < 0)
+ err(1, "Cannot set filemon PID");
+ }
+
doshell(argv);
+ }
close(slave);
- if (fflg && ioctl(fm_fd, FILEMON_SET_PID, &child) < 0)
- err(1, "Cannot set filemon PID");
-
start = tvec = time(0);
readstdin = 1;
for (;;) {