summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-04-12 15:37:38 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-04-12 15:37:40 +0200
commit33239bf89e41771798cf2d49a3c5564806f5582c (patch)
tree8084e2e324705bf2bbdcf6742903571a526f4766
parent071912e070167ada794fbd9923d36def7e714d4a (diff)
downloadgnutls-33239bf89e41771798cf2d49a3c5564806f5582c.tar.gz
load_dir_certs: use readdir() in all platforms
According to glibc documentation readdir_r() is deprecated and the use of readdir() is recommended. As such we switch to it on all platforms.
-rw-r--r--lib/x509/verify-high2.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/x509/verify-high2.c b/lib/x509/verify-high2.c
index 46a0db9f68..e79aedc72d 100644
--- a/lib/x509/verify-high2.c
+++ b/lib/x509/verify-high2.c
@@ -379,24 +379,16 @@ int load_dir_certs(const char *dirname,
int ret;
int r = 0;
char path[GNUTLS_PATH_MAX];
-#ifndef _WIN32
- struct dirent e;
-#endif
dirp = opendir(dirname);
if (dirp != NULL) {
do {
-#ifdef _WIN32
d = readdir(dirp);
- if (d != NULL) {
-#else
- ret = readdir_r(dirp, &e, &d);
- if (ret == 0 && d != NULL
+ if (d != NULL
#ifdef _DIRENT_HAVE_D_TYPE
&& (d->d_type == DT_REG || d->d_type == DT_LNK || d->d_type == DT_UNKNOWN)
#endif
) {
-#endif
snprintf(path, sizeof(path), "%s/%s",
dirname, d->d_name);