Date: Mon, 26 Oct 2015 00:09:31 +0000 (UTC) From: Garrett Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r289973 - stable/9/lib/libcam Message-ID: <201510260009.t9Q09V3X044660@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@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 *
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510260009.t9Q09V3X044660>