Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
readdir_r(3) is deprecated, use readdir(3) instead
gcc 7.3.1 provides the following warning when compiling affinity.c: affinity.c: In function ‘affinity_file’: affinity.c:158:2: warning: ‘readdir_r’ is deprecated [-Wdeprecated-declarations] while (readdir_r(dir, &de, &dep) == 0 && dep) { ^~~~~ In file included from affinity.c:39:0: /usr/include/dirent.h:183:12: note: declared here extern int readdir_r (DIR *__restrict __dirp, ^~~~~~~~~ According to the man page for readdir_r(3), calls this function should be fixed to instead use readdir(3). One interesting note: I had to move the affinity_class() call above the closedir(dir) call in affinity_file() because with readdir(3) the string stored in 'name' is cleared on closedir(). This doesn't happen with readdir_r() for some reason. Signed-off-by: Ross Zwisler <[email protected]>
- Loading branch information