From 20fc8773b65ed1de0aa7b2a638dbb74427ee516d Mon Sep 17 00:00:00 2001 From: Jan Andres Date: Mon, 4 Aug 2014 08:45:38 +0200 Subject: [PATCH 1/3] Build fix for Solaris refs #6821 Signed-off-by: Gunnar Beutner --- lib/base/utility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp index 4d13444f0..dfb31808a 100644 --- a/lib/base/utility.cpp +++ b/lib/base/utility.cpp @@ -90,7 +90,7 @@ String Utility::GetSymbolName(const void *addr) #ifdef HAVE_DLADDR Dl_info dli; - if (dladdr(addr, &dli) > 0) + if (dladdr(const_cast(addr), &dli) > 0) return dli.dli_sname; #endif /* HAVE_DLADDR */ From 46dbe5a4f5e06156edd0ae1c921b5de1202d1ea0 Mon Sep 17 00:00:00 2001 From: Jan Andres Date: Mon, 4 Aug 2014 08:46:14 +0200 Subject: [PATCH 2/3] Fix incorrect usage of readdir_r refs #6821 Signed-off-by: Gunnar Beutner --- lib/base/utility.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp index dfb31808a..aa804414a 100644 --- a/lib/base/utility.cpp +++ b/lib/base/utility.cpp @@ -545,13 +545,15 @@ bool Utility::GlobRecursive(const String& path, const String& pattern, const boo << boost::errinfo_file_name(path)); while (dirp) { - dirent ent, *pent; + dirent *pent; - if (readdir_r(dirp, &ent, &pent) < 0) { + errno = 0; + pent = readdir(dirp); + if (!pent && errno != 0) { closedir(dirp); BOOST_THROW_EXCEPTION(posix_error() - << boost::errinfo_api_function("readdir_r") + << boost::errinfo_api_function("readdir") << boost::errinfo_errno(errno) << boost::errinfo_file_name(path)); } @@ -559,10 +561,10 @@ bool Utility::GlobRecursive(const String& path, const String& pattern, const boo if (!pent) break; - if (strcmp(ent.d_name, ".") == 0 || strcmp(ent.d_name, "..") == 0) + if (strcmp(pent->d_name, ".") == 0 || strcmp(pent->d_name, "..") == 0) continue; - String cpath = path + "/" + ent.d_name; + String cpath = path + "/" + pent->d_name; struct stat statbuf; @@ -572,7 +574,7 @@ bool Utility::GlobRecursive(const String& path, const String& pattern, const boo if (S_ISDIR(statbuf.st_mode)) alldirs.push_back(cpath); - if (!Utility::Match(pattern, ent.d_name)) + if (!Utility::Match(pattern, pent->d_name)) continue; if (S_ISDIR(statbuf.st_mode) && (type & GlobDirectory)) From 9c7be0e776923e79fe2f6910babcddf261844ac7 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 4 Aug 2014 08:48:05 +0200 Subject: [PATCH 3/3] Update AUTHORS refs #6821 --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 656c1db44..9615e241d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -5,6 +5,7 @@ Gaƫl Beaudoin Gerd von Egidy Gunnar Beutner Ildar Hizbulin +Jan Andres Jan Wagner Jason Young Johannes Meyer