svn commit: r289973 - stable/9/lib/libcam

Garrett Cooper ngie at FreeBSD.org
Mon Oct 26 00:09:32 UTC 2015


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.ferris at 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 *


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