guacamole-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmuehl...@apache.org
Subject [1/2] incubator-guacamole-server git commit: GUACAMOLE-94: Use readdir() instead of readdir_r(). Multiple threads will not be accessing the same directory stream.
Date Sun, 29 Jan 2017 20:31:32 GMT
Repository: incubator-guacamole-server
Updated Branches:
  refs/heads/master 0d0f6b9c6 -> 135514a0d


GUACAMOLE-94: Use readdir() instead of readdir_r(). Multiple threads will not be accessing
the same directory stream.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/dc6cae46
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/dc6cae46
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/dc6cae46

Branch: refs/heads/master
Commit: dc6cae46ca40ca1af04901faf73dac6003c70e61
Parents: ea6b094
Author: Michael Jumper <mjumper@apache.org>
Authored: Sat Jan 28 00:11:59 2017 -0800
Committer: Michael Jumper <mjumper@apache.org>
Committed: Sat Jan 28 00:11:59 2017 -0800

----------------------------------------------------------------------
 src/protocols/rdp/rdp_fs.c | 10 +++-------
 src/protocols/rdp/rdp_fs.h |  6 ------
 2 files changed, 3 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/dc6cae46/src/protocols/rdp/rdp_fs.c
----------------------------------------------------------------------
diff --git a/src/protocols/rdp/rdp_fs.c b/src/protocols/rdp/rdp_fs.c
index 2909fea..28019d8 100644
--- a/src/protocols/rdp/rdp_fs.c
+++ b/src/protocols/rdp/rdp_fs.c
@@ -595,16 +595,12 @@ const char* guac_rdp_fs_read_dir(guac_rdp_fs* fs, int file_id) {
             return NULL;
     }
 
-    /* Read next entry, stop if error */
-    if (readdir_r(file->dir, &(file->__dirent), &result))
-        return NULL;
-
-    /* If no more entries, return NULL */
-    if (result == NULL)
+    /* Read next entry, stop if error or no more entries */
+    if ((result = readdir(file->dir)) == NULL)
         return NULL;
 
     /* Return filename */
-    return file->__dirent.d_name;
+    return result->d_name;
 
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/dc6cae46/src/protocols/rdp/rdp_fs.h
----------------------------------------------------------------------
diff --git a/src/protocols/rdp/rdp_fs.h b/src/protocols/rdp/rdp_fs.h
index 312679d..abdda10 100644
--- a/src/protocols/rdp/rdp_fs.h
+++ b/src/protocols/rdp/rdp_fs.h
@@ -217,12 +217,6 @@ typedef struct guac_rdp_fs_file {
     DIR* dir;
 
     /**
-     * The last read dirent structure. This is used if traversing the contents
-     * of a directory.
-     */
-    struct dirent __dirent;
-
-    /**
      * The pattern the check directory contents against, if any.
      */
     char dir_pattern[GUAC_RDP_FS_MAX_PATH];


Mime
View raw message