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),
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to