diff options
author | obrien <obrien@FreeBSD.org> | 2012-10-26 20:24:13 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2012-10-26 20:24:13 +0000 |
commit | 1c02e94653db5a9d56e5b294d886466a94cdcd35 (patch) | |
tree | bf2da559ae87db9be1789c45dc186cfb80189caa /sys/dev/filemon/filemon.c | |
parent | bdeb3f5a2077ca1a8ea6d3277a13ca04232f5ca1 (diff) | |
download | FreeBSD-src-1c02e94653db5a9d56e5b294d886466a94cdcd35.zip FreeBSD-src-1c02e94653db5a9d56e5b294d886466a94cdcd35.tar.gz |
A little bit easier to read.
Diffstat (limited to 'sys/dev/filemon/filemon.c')
-rw-r--r-- | sys/dev/filemon/filemon.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/filemon/filemon.c b/sys/dev/filemon/filemon.c index 355e3aa..0108ed1 100644 --- a/sys/dev/filemon/filemon.c +++ b/sys/dev/filemon/filemon.c @@ -136,6 +136,12 @@ filemon_dtr(void *data) } } +#if __FreeBSD_version < 900041 +#define FGET_WRITE(a1, a2, a3) fget_write((a1), (a2), (a3)) +#else +#define FGET_WRITE(a1, a2, a3) fget_write((a1), (a2), CAP_WRITE | CAP_SEEK, (a3)) +#endif + static int filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag __unused, struct thread *td) @@ -148,11 +154,6 @@ filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag __unused, switch (cmd) { /* Set the output file descriptor. */ case FILEMON_SET_FD: -#if __FreeBSD_version < 900041 -#define FGET_WRITE(a1, a2, a3) fget_write((a1), (a2), (a3)) -#else -#define FGET_WRITE(a1, a2, a3) fget_write((a1), (a2), CAP_WRITE | CAP_SEEK, (a3)) -#endif if ((error = FGET_WRITE(td, *(int *)data, &filemon->fp)) == 0) /* Write the file header. */ filemon_comment(filemon); @@ -160,7 +161,7 @@ filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag __unused, /* Set the monitored process ID. */ case FILEMON_SET_PID: - filemon->pid = *((pid_t *) data); + filemon->pid = *((pid_t *)data); break; default: |