[前][次][番号順一覧][スレッド一覧]

ruby-changes:49639

From: normal <ko1@a...>
Date: Wed, 10 Jan 2018 10:07:34 +0900 (JST)
Subject: [ruby-changes:49639] normal:r61754 (trunk): dir.c: pass flags to openat(2) correctly

normal	2018-01-10 10:07:27 +0900 (Wed, 10 Jan 2018)

  New Revision: 61754

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61754

  Log:
    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]

  Modified files:
    trunk/dir.c
Index: dir.c
===================================================================
--- dir.c	(revision 61753)
+++ dir.c	(revision 61754)
@@ -1447,7 +1447,7 @@ nogvl_opendir_at(void *ptr) https://github.com/ruby/ruby/blob/trunk/dir.c#L1447
 			       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) {
@@ -1455,7 +1455,7 @@ nogvl_opendir_at(void *ptr) https://github.com/ruby/ruby/blob/trunk/dir.c#L1455
 
 	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;
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]