svn commit: r296143 - stable/9/sys/dev/filemon

Bryan Drewery bdrewery at FreeBSD.org
Sat Feb 27 20:45:08 UTC 2016


Author: bdrewery
Date: Sat Feb 27 20:45:07 2016
New Revision: 296143
URL: https://svnweb.freebsd.org/changeset/base/296143

Log:
  MFC r294933:
  
    Drop any previous fd when setting a new one.

Modified:
  stable/9/sys/dev/filemon/filemon.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/filemon/filemon.c
==============================================================================
--- stable/9/sys/dev/filemon/filemon.c	Sat Feb 27 20:39:36 2016	(r296142)
+++ stable/9/sys/dev/filemon/filemon.c	Sat Feb 27 20:45:07 2016	(r296143)
@@ -185,6 +185,9 @@ filemon_ioctl(struct cdev *dev, u_long c
 	switch (cmd) {
 	/* Set the output file descriptor. */
 	case FILEMON_SET_FD:
+		if (filemon->fp != NULL)
+			fdrop(filemon->fp, td);
+
 #if __FreeBSD_version < 900041
 #define FGET_WRITE(a1, a2, a3) fget_write((a1), (a2), (a3))
 #else


More information about the svn-src-stable-9 mailing list