svn commit: r296917 - releng/10.3/usr.bin/script
Bryan Drewery
bdrewery at FreeBSD.org
Tue Mar 15 19:45:25 UTC 2016
Author: bdrewery
Date: Tue Mar 15 19:45:24 2016
New Revision: 296917
URL: https://svnweb.freebsd.org/changeset/base/296917
Log:
MFS r296911:
Filemon: Attach from the child to avoid racing with the parent attach.
Relnotes: yes
Approved by: re (marius)
Modified:
releng/10.3/usr.bin/script/script.c
Directory Properties:
releng/10.3/ (props changed)
Modified: releng/10.3/usr.bin/script/script.c
==============================================================================
--- releng/10.3/usr.bin/script/script.c Tue Mar 15 19:34:58 2016 (r296916)
+++ releng/10.3/usr.bin/script/script.c Tue Mar 15 19:45:24 2016 (r296917)
@@ -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 (;;) {
More information about the svn-src-releng
mailing list