summaryrefslogtreecommitdiffstats
path: root/sys/dev/filemon/filemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/filemon/filemon.c')
-rw-r--r--sys/dev/filemon/filemon.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/filemon/filemon.c b/sys/dev/filemon/filemon.c
index 4f24bbb..352f682 100644
--- a/sys/dev/filemon/filemon.c
+++ b/sys/dev/filemon/filemon.c
@@ -89,7 +89,7 @@ struct filemon {
TAILQ_ENTRY(filemon) link; /* Link into the in-use list. */
struct sx lock; /* Lock mutex for this filemon. */
struct file *fp; /* Output file pointer. */
- pid_t pid; /* The process ID being monitored. */
+ struct proc *p; /* The process being monitored. */
char fname1[MAXPATHLEN]; /* Temporary filename buffer. */
char fname2[MAXPATHLEN]; /* Temporary filename buffer. */
char msgbufr[1024]; /* Output message buffer. */
@@ -137,7 +137,7 @@ filemon_dtr(void *data)
fp = filemon->fp;
filemon->fp = NULL;
- filemon->pid = -1;
+ filemon->p = NULL;
/* Add to the free list. */
TAILQ_INSERT_TAIL(&filemons_free, filemon, link);
@@ -188,7 +188,7 @@ filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag __unused,
error = pget(*((pid_t *)data), PGET_CANDEBUG | PGET_NOTWEXIT,
&p);
if (error == 0) {
- filemon->pid = p->p_pid;
+ filemon->p = p;
PROC_UNLOCK(p);
}
break;
@@ -221,7 +221,6 @@ filemon_open(struct cdev *dev, int oflags __unused, int devtype __unused,
filemon = malloc(sizeof(struct filemon), M_FILEMON,
M_WAITOK | M_ZERO);
sx_init(&filemon->lock, "filemon");
- filemon->pid = -1;
}
devfs_set_cdevpriv(filemon, filemon_dtr);
OpenPOWER on IntegriCloud