summaryrefslogtreecommitdiffstats
path: root/share/man/man4/filemon.4
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2012-06-05 17:36:28 +0000
committerobrien <obrien@FreeBSD.org>2012-06-05 17:36:28 +0000
commit5bfb5484b949f9e2bfff3af3622d69ffb4aab60e (patch)
treeeddd865de82c10196113fa1816c6cc3b683b62b6 /share/man/man4/filemon.4
parentbd7c494553b21d5d94f2a40354ce0870d76380ad (diff)
downloadFreeBSD-src-5bfb5484b949f9e2bfff3af3622d69ffb4aab60e.zip
FreeBSD-src-5bfb5484b949f9e2bfff3af3622d69ffb4aab60e.tar.gz
Correct examples to the latest version I had.
Diffstat (limited to 'share/man/man4/filemon.4')
-rw-r--r--share/man/man4/filemon.47
1 files changed, 4 insertions, 3 deletions
diff --git a/share/man/man4/filemon.4 b/share/man/man4/filemon.4
index e8b24bf..9105eca 100644
--- a/share/man/man4/filemon.4
+++ b/share/man/man4/filemon.4
@@ -127,18 +127,19 @@ open_filemon(void)
O_CREAT | O_WRONLY | O_TRUNC, DEFFILEMODE)) == -1)
err(1, "open(filemon.out)");
- if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) < 0)
+ if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) == -1)
err(1, "Cannot set filemon log file descriptor");
/* Set up these two fd's to close on exec. */
(void)fcntl(fm_fd, F_SETFD, FD_CLOEXEC);
(void)fcntl(fm_log, F_SETFD, FD_CLOEXEC);
if ((child = fork()) == 0) {
+ child = getpid();
+ if (ioctl(fm_fd, FILEMON_SET_PID, &child) == -1)
+ err(1, "Cannot set filemon PID");
/* Do something here. */
return 0;
} else {
- if (ioctl(fm_fd, FILEMON_SET_PID, &child) < 0)
- err(1, "Cannot set filemon PID");
wait(&child);
close(fm_fd);
}
OpenPOWER on IntegriCloud