summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-16 08:31:35 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-16 08:31:35 +0000
commit55c5054c031cf0a5cb6a86fac5e0dca6f2e0faaa (patch)
tree882d3353426d66aaf71ab9ea6e48eec3ff3dbad5 /dir.c
parent38aa1376664f217cbbf74db0f49c8eebe098156a (diff)
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
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c4
1 files changed, 2 insertions, 2 deletions
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;