From 55c5054c031cf0a5cb6a86fac5e0dca6f2e0faaa Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 16 Feb 2018 08:31:35 +0000 Subject: merge revision(s) 61754: [Backport #14346] dir.c: pass flags to openat(2) correctly Flags are 3rd argument of openat(2) while the 4th argument (mode_t) is unnecessary for our uses. This bug exists since Ruby 2.5 from r58860 and was discoverd by strace. * dir.c (nogvl_opendir_at): use openat correctly [Feature #13056] [Feature #14346] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dir.c') diff --git a/dir.c b/dir.c index 7d4dc8781f..5ebad0a49b 100644 --- a/dir.c +++ b/dir.c @@ -1446,7 +1446,7 @@ nogvl_opendir_at(void *ptr) O_DIRECTORY| # endif /* O_DIRECTORY */ 0); - int fd = openat(oaa->basefd, oaa->path, 0, opendir_flags); + int fd = openat(oaa->basefd, oaa->path, opendir_flags); dirp = fd >= 0 ? fdopendir(fd) : 0; if (!dirp) { @@ -1454,7 +1454,7 @@ nogvl_opendir_at(void *ptr) switch (gc_for_fd_with_gvl(e)) { default: - if (fd < 0) fd = openat(oaa->basefd, oaa->path, 0, opendir_flags); + if (fd < 0) fd = openat(oaa->basefd, oaa->path, opendir_flags); if (fd >= 0) dirp = fdopendir(fd); if (dirp) return dirp; -- cgit v1.2.3