Fix build failure caused by use of the deprecated readdir_r(3) while building with -Werror=deprecated-declarations Patch copied from upstream source repository: https://github.com/daveol/ola/commit/9d8575ff38f76df698ea8889e07a3dee8f21bd68 From 9d8575ff38f76df698ea8889e07a3dee8f21bd68 Mon Sep 17 00:00:00 2001 From: Dave Olsthoorn Date: Wed, 2 Mar 2016 11:22:17 +0100 Subject: [PATCH] Use readdir instead of readdir_r This replacec the use of readdir_r with readdir since readdir seems to be both dangarous and deprecated in newer versions of glibc. This fixes #1055 --- common/file/Util.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/common/file/Util.cpp b/common/file/Util.cpp index e2261fd..0ffddd3 100644 --- a/common/file/Util.cpp +++ b/common/file/Util.cpp @@ -128,30 +128,29 @@ bool FindMatchingFiles(const string &directory, FindClose(h_find); #else DIR *dp; - struct dirent dir_ent; - struct dirent *dir_ent_p; + struct dirent *dir_ent; if ((dp = opendir(directory.data())) == NULL) { OLA_WARN << "Could not open " << directory << ":" << strerror(errno); return false; } - if (readdir_r(dp, &dir_ent, &dir_ent_p)) { - OLA_WARN << "readdir_r(" << directory << "): " << strerror(errno); + if ((dir_ent = readdir(dp)) == NULL) { + OLA_WARN << "readdir(" << directory << "): " << strerror(errno); closedir(dp); return false; } - while (dir_ent_p != NULL) { + while (dir_ent != NULL) { vector::const_iterator iter; for (iter = prefixes.begin(); iter != prefixes.end(); ++iter) { - if (!strncmp(dir_ent_p->d_name, iter->data(), iter->size())) { + if (!strncmp(dir_ent->d_name, iter->data(), iter->size())) { std::ostringstream str; - str << directory << PATH_SEPARATOR << dir_ent_p->d_name; + str << directory << PATH_SEPARATOR << dir_ent->d_name; files->push_back(str.str()); } } - if (readdir_r(dp, &dir_ent, &dir_ent_p)) { - OLA_WARN << "readdir_r(" << directory << "): " << strerror(errno); + if ((dir_ent = readdir(dp)) == NULL) { + OLA_WARN << "readdir(" << directory << "): " << strerror(errno); closedir(dp); return false; } hover'>AgeCommit message (Expand)Author 2024-09-08images: wsl2: Update comment....* gnu/system/images/wsl2.scm (wsl-boot-program): Update privileged program directory in a comment. Change-Id: I65906cbfbcd17ff164837ad293dc4324314bfcf1 Tobias Geerinckx-Rice 2024-09-08privilege: Add file-like->setuid-program helper....* gnu/system/privilege.scm (file-like->setuid-program): New public procedure. * gnu/system/setuid.scm: Re-export it for compatibility. (file-like->setuid-program): Remove this old version. * gnu/services/docker.scm (singularity-setuid-programs): Use it (again). * gnu/services/desktop.scm (enlightenment-privileged-programs): Likewise. Change-Id: I8e41144438677a15cdadb3063651dbc780715497 Tobias Geerinckx-Rice 2024-09-01uuid: Add support for exFAT....We expect users to use the generic STRING->FAT-UUID procedure. This is consistent with how we already treat FAT32 vs FAT16. It is not consistent with how we export 8 different aliases for STRING->DCE-UUID, but I'm unconvinced that would be better. * gnu/system/uuid.scm (%uuid-parsers, %uuid-printers): Add the ‘exfat’ file system type. Change-Id: Ia31482716e4395f9f10f794f49fb31c9f330a2e3 Tobias Geerinckx-Rice 2024-09-09system: locale: ‘glibc-supported-locales’ uses zstd instead of xz....This is a followup to c9666c120b8e40321d6044f572533e160c1e0351. Fixes <https://issues.guix.gnu.org/73065>. * gnu/system/locale.scm (glibc-supported-locales): Change XZ to ZSTD. Change-Id: Ie3cb5d50648a0698ce5246591fb405e4eb690af5 Ludovic Courtès 2024-08-31gnu: %default-locale-libcs: Add glibc-2.35 and generalize for Hurd....* gnu/system/locale.scm (%default-locale-libcs): Stop checking for Hurd, since we have the same libc now. Also add glibc-2.35 while the transition happens. Change-Id: I1f4980d18184580f3a42a86ca244c8015df15269 Josselin Poiret