ruby-changes:46797
From: nobu <ko1@a...>
Date: Sat, 27 May 2017 10:04:27 +0900 (JST)
Subject: [ruby-changes:46797] nobu:r58912 (trunk): dir.c: fix FD leaks
nobu 2017-05-27 10:04:23 +0900 (Sat, 27 May 2017) New Revision: 58912 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58912 Log: dir.c: fix FD leaks * dir.c (do_opendir): close FD when fdopendir failed, e.g., ENOTDIR. [Feature#13056] Modified files: trunk/dir.c Index: dir.c =================================================================== --- dir.c (revision 58911) +++ dir.c (revision 58912) @@ -1372,11 +1372,11 @@ do_opendir(const int basefd, const char https://github.com/ruby/ruby/blob/trunk/dir.c#L1372 #endif if (dirp) break; e = errno; + /* fallback */ + case 0: #if USE_OPENDIR_AT if (fd >= 0) close(fd); #endif - /* fallback */ - case 0: *status = 0; if (to_be_ignored(e)) break; if (errfunc) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/