diff options
| author | Bryan Drewery <bdrewery@FreeBSD.org> | 2016-03-15 19:45:24 +0000 |
|---|---|---|
| committer | Bryan Drewery <bdrewery@FreeBSD.org> | 2016-03-15 19:45:24 +0000 |
| commit | 567ab48e449a92b69f003b89ccf96ad17dc101b9 (patch) | |
| tree | 8c5e9bbf7568db53c85e447edda22da35856a27b /usr.bin/script | |
| parent | 96e6249c961b9c86f5e272504c3aac6a7491dcce (diff) | |
Notes
Diffstat (limited to 'usr.bin/script')
| -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 4e5e3137240d..1fb79f3b40aa 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 (;;) { |
