diff options
author | James Buren <ryuo@frugalware.org> | 2017-05-08 12:47:17 +0200 |
---|---|---|
committer | Juergen Daubert <jue@jue.li> | 2017-05-08 13:30:41 +0200 |
commit | d511d7bab008523d2d8303453b028380930a7243 (patch) | |
tree | b6a512eb9efd48f508d19a34174d8570198d085b | |
parent | decc2bc3207db7809aa5b3587da580e1db9470e2 (diff) | |
download | prt-utils-d511d7bab008523d2d8303453b028380930a7243.tar.gz prt-utils-d511d7bab008523d2d8303453b028380930a7243.tar.xz |
revdep: replace deprecated readdir_r with readdir
According to recent man-pages on readdir, it is now
thread-safe in recent glibc implementations. It should
be safe to replace readdir_r with it now and avoid the
deprecation warnings.
-rw-r--r-- | revdep/pkg.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/revdep/pkg.cpp b/revdep/pkg.cpp index f79a872..9be5fbf 100644 --- a/revdep/pkg.cpp +++ b/revdep/pkg.cpp @@ -83,22 +83,22 @@ void ReadPackageDirs(const std::string &path, PackageVector &pkgs) { return; } - struct dirent de, *res; + struct dirent *de; - while(readdir_r(dir, &de, &res) == 0 && res != NULL) { - if(de.d_type != DT_REG) { + while((de = readdir(dir)) != NULL) { + if(de->d_type != DT_REG) { continue; } StringVector dirs; - ReadRdConf(path + "/" + de.d_name, dirs); + ReadRdConf(path + "/" + de->d_name, dirs); if(dirs.size() == 0) { continue; } - PackageVector::iterator pkg = std::find(pkgs.begin(), pkgs.end(), de.d_name); + PackageVector::iterator pkg = std::find(pkgs.begin(), pkgs.end(), de->d_name); if(pkg == pkgs.end()) { continue; |