diff options
-rw-r--r-- | usr.bin/script/script.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index 4e5e313..1fb79f3 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -221,13 +221,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 (;;) { |