Drop any previous fd when setting a new one.
Reported by: mjg Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks
This commit is contained in:
parent
57a7c410cb
commit
4019d3df8f
@ -148,6 +148,9 @@ 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 (filemon->fp != NULL)
|
||||
fdrop(filemon->fp, td);
|
||||
|
||||
error = fget_write(td, *(int *)data,
|
||||
#if __FreeBSD_version >= 900041
|
||||
cap_rights_init(&rights, CAP_PWRITE),
|
||||
|
Loading…
x
Reference in New Issue
Block a user