svn commit: r294933 - head/sys/dev/filemon

Bryan Drewery bdrewery at FreeBSD.org
Wed Jan 27 19:11:13 UTC 2016


Author: bdrewery
Date: Wed Jan 27 19:11:11 2016
New Revision: 294933
URL: https://svnweb.freebsd.org/changeset/base/294933

Log:
  Drop any previous fd when setting a new one.
  
  Reported by:	mjg
  Sponsored by:	EMC / Isilon Storage Division
  MFC after:	2 weeks

Modified:
  head/sys/dev/filemon/filemon.c

Modified: head/sys/dev/filemon/filemon.c
==============================================================================
--- head/sys/dev/filemon/filemon.c	Wed Jan 27 18:12:42 2016	(r294932)
+++ head/sys/dev/filemon/filemon.c	Wed Jan 27 19:11:11 2016	(r294933)
@@ -148,6 +148,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);
+
 		error = fget_write(td, *(int *)data,
 #if __FreeBSD_version >= 900041
 		    cap_rights_init(&rights, CAP_PWRITE),


More information about the svn-src-all mailing list