Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Mar 2018 23:56:54 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r331398 - stable/11/cddl/contrib/opensolaris/lib/libzfs/common
Message-ID:  <201803222356.w2MNusQ2001211@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Mar 22 23:56:53 2018
New Revision: 331398
URL: https://svnweb.freebsd.org/changeset/base/331398

Log:
  MFC r329691: MFV r322231:
  8430 dir_is_empty_readdir() doesn't properly handle error from fdopendir()
  
  illumos/illumos-gate@ba6e7e6505150388de6dc6a88741164118a421bf
  https://github.com/illumos/illumos-gate/commit/ba6e7e6505150388de6dc6a88741164118a421bf
  
  https://www.illumos.org/issues/8430
    we should close dirfd if fdopendir() fails.
  
  Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
  Reviewed by: Matthew Ahrens <mahrens@delphix.com>
  Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
  Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
  Reviewed by: Igor Kozhukhov <igor@dilos.org>
  Approved by: Robert Mustacchi <rm@joyent.com>
  Author: Sowrabha Gopal <sowrabha.gopal@delphix.com>

Modified:
  stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
==============================================================================
--- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c	Thu Mar 22 23:56:17 2018	(r331397)
+++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c	Thu Mar 22 23:56:53 2018	(r331398)
@@ -216,6 +216,7 @@ dir_is_empty_readdir(const char *dirname)
 	}
 
 	if ((dirp = fdopendir(dirfd)) == NULL) {
+		(void) close(dirfd);
 		return (B_TRUE);
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803222356.w2MNusQ2001211>