diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-04-12 15:37:38 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2017-12-10 15:31:42 +0100 |
commit | ffc8274c0cc181480b7d369ab7e7711d8670c381 (patch) | |
tree | be514752e91b303666c62c050e36fc73d5dd773f | |
parent | de342ba42c3b16e00823d85906f789a0c46df61b (diff) | |
download | gnutls-ffc8274c0cc181480b7d369ab7e7711d8670c381.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.c | 10 |
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); |