summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-04-12 15:37:38 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2017-12-10 15:31:42 +0100
commitffc8274c0cc181480b7d369ab7e7711d8670c381 (patch)
treebe514752e91b303666c62c050e36fc73d5dd773f
parentde342ba42c3b16e00823d85906f789a0c46df61b (diff)
downloadgnutls_3_3_x_backports.tar.gz
load_dir_certs: use readdir() in all platformsgnutls_3_3_x_backports
According to glibc documentation readdir_r() is deprecated and the use of readdir() is recommended. As such we switch to it on all platforms. Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-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 6b5d075aec..63b93e5b04 100644
--- a/lib/x509/verify-high2.c
+++ b/lib/x509/verify-high2.c
@@ -377,24 +377,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);