[Git][reproducible-builds/disorderfs][master] Rewrite call to readdir_r(3) to use readdir(3) instead as the former has been…
Chris Lamb
gitlab at salsa.debian.org
Sun Jun 3 18:56:05 CEST 2018
Chris Lamb pushed to branch master at Reproducible Builds / disorderfs
Commits:
fbfd4d02 by Chris Lamb at 2018-06-03T17:55:53+01:00
Rewrite call to readdir_r(3) to use readdir(3) instead as the former has been deprecated in glibc 2.24. This silences a -Wdeprecated-declarations GCC warning.
- - - - -
1 changed file:
- disorderfs.cpp
Changes:
=====================================
disorderfs.cpp
=====================================
--- a/disorderfs.cpp
+++ b/disorderfs.cpp
@@ -425,12 +425,14 @@ int main (int argc, char** argv)
if (!d) {
return -errno;
}
- struct dirent dirent_storage;
struct dirent* dirent_p;
- int res;
- while ((res = readdir_r(d, &dirent_storage, &dirent_p)) == 0 && dirent_p) {
+ errno = 0;
+ while ((dirent_p = readdir(d)) != NULL) {
dirents->emplace_back(std::make_pair(dirent_p->d_name, dirent_p->d_ino));
}
+ if (errno != 0) {
+ return -errno;
+ }
if (config.sort_dirents) {
std::sort(dirents->begin(), dirents->end());
}
@@ -438,8 +440,8 @@ int main (int argc, char** argv)
std::reverse(dirents->begin(), dirents->end());
}
closedir(d);
- if (res != 0) {
- return -res;
+ if (errno != 0) {
+ return -errno;
}
set_fuse_data<Dirents*>(info, dirents.release());
View it on GitLab: https://salsa.debian.org/reproducible-builds/disorderfs/commit/fbfd4d0281d4e25a4f42a7ee9606423b249e06ef
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/disorderfs/commit/fbfd4d0281d4e25a4f42a7ee9606423b249e06ef
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20180603/c4b19b8d/attachment.html>
More information about the rb-commits
mailing list