Author: ngie
Date: Mon Oct 26 00:09:30 2015
New Revision: 289973
URL: https://svnweb.freebsd.org/changeset/base/289973

Log:
  MFstable/10 r289972:
  
  MFC r289450:
  
  Set dev->fd to -1 when calling cam_close_spec_device with a valid dev->fd
  descriptor to avoid trashing valid file descriptors that access dev->fd at a
  later point in time
  
  PR: 192671
  Submitted by: Scott Ferris <scott.fer...@isilon.com>
  Sponsored by: EMC / Isilon Storage Division

Modified:
  stable/9/lib/libcam/camlib.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/lib/   (props changed)
  stable/9/lib/libcam/   (props changed)

Modified: stable/9/lib/libcam/camlib.c
==============================================================================
--- stable/9/lib/libcam/camlib.c        Mon Oct 26 00:08:40 2015        
(r289972)
+++ stable/9/lib/libcam/camlib.c        Mon Oct 26 00:09:30 2015        
(r289973)
@@ -675,8 +675,10 @@ cam_close_spec_device(struct cam_device 
        if (dev == NULL)
                return;
 
-       if (dev->fd >= 0)
+       if (dev->fd >= 0) {
                close(dev->fd);
+               dev->fd = -1;
+       }
 }
 
 char *
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to