[Fawkes Git] branch/thofmann/gcc6: utils: replace deprecated readdir_r by readdir

Till Hofmann hofmann at kbsg.rwth-aachen.de
Fri Aug 26 18:34:28 CEST 2016


Changes have been pushed for the project "Fawkes Robotics Software Framework".

Gitweb: http://git.fawkesrobotics.org/fawkes.git
Trac:   http://trac.fawkesrobotics.org

The branch, thofmann/gcc6 has been updated
        to  58ed958df78fca0f30619021741ad8c7e6e5e090 (commit)
      from  64eb9ea985d93855bd99e6178d96d111adeb21ae (commit)

http://git.fawkesrobotics.org/fawkes.git/thofmann/gcc6

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- *Log* ---------------------------------------------------------------
commit 58ed958df78fca0f30619021741ad8c7e6e5e090
Author:     Till Hofmann <hofmann at kbsg.rwth-aachen.de>
AuthorDate: Fri Aug 26 17:24:16 2016 +0200
Commit:     Till Hofmann <hofmann at kbsg.rwth-aachen.de>
CommitDate: Fri Aug 26 17:24:16 2016 +0200

    utils: replace deprecated readdir_r by readdir
    
    The function readdir_r has been deprecated and GCC6 complains about it.
    Replace the function call by a call to readdir as recommended by the man
    page.

http://git.fawkesrobotics.org/fawkes.git/commit/58ed958
http://trac.fawkesrobotics.org/changeset/58ed958

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


- *Summary* -----------------------------------------------------------
 src/libs/utils/system/fam.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


- *Diffs* -------------------------------------------------------------

- *commit* 58ed958df78fca0f30619021741ad8c7e6e5e090 - - - - - - - - - -
Author:  Till Hofmann <hofmann at kbsg.rwth-aachen.de>
Date:    Fri Aug 26 17:24:16 2016 +0200
Subject: utils: replace deprecated readdir_r by readdir

 src/libs/utils/system/fam.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

_Diff for modified files_:
diff --git a/src/libs/utils/system/fam.cpp b/src/libs/utils/system/fam.cpp
index b75c239..29acb99 100644
--- a/src/libs/utils/system/fam.cpp
+++ b/src/libs/utils/system/fam.cpp
@@ -170,12 +170,12 @@ FileAlterationMonitor::watch_dir(const char *dirpath)
   if ( (iw = inotify_add_watch(__inotify_fd, dirpath, mask)) >= 0) {
     __inotify_watches[iw] = dirpath;
 
-    dirent de, *res;
-    while ( (readdir_r(d, &de, &res) == 0) && (res != NULL) ) {
-      std::string fp = std::string(dirpath) + "/" + de.d_name;
+    dirent *de;
+    while ( (de = readdir(d)) ) {
+      std::string fp = std::string(dirpath) + "/" + de->d_name;
       struct stat st;
       if ( stat(fp.c_str(), &st) == 0 ) {
-	if ( (de.d_name[0] != '.') && S_ISDIR(st.st_mode) ) {
+        if ( (de->d_name[0] != '.') && S_ISDIR(st.st_mode) ) {
 	  try {
 	    watch_dir(fp.c_str());
 	  } catch (Exception &e) {




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org


More information about the fawkes-commits mailing list