svn commit: r289972 - stable/10/lib/libcam

Garrett Cooper ngie at FreeBSD.org
Mon Oct 26 00:08:42 UTC 2015


Author: ngie
Date: Mon Oct 26 00:08:40 2015
New Revision: 289972
URL: https://svnweb.freebsd.org/changeset/base/289972

Log:
  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/10/lib/libcam/camlib.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libcam/camlib.c
==============================================================================
--- stable/10/lib/libcam/camlib.c	Mon Oct 26 00:07:11 2015	(r289971)
+++ stable/10/lib/libcam/camlib.c	Mon Oct 26 00:08:40 2015	(r289972)
@@ -676,8 +676,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-10 mailing list