From ffc8274c0cc181480b7d369ab7e7711d8670c381 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Tue, 12 Apr 2016 15:37:38 +0200 Subject: 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. Signed-off-by: Nikos Mavrogiannopoulos --- lib/x509/verify-high2.c | 10 +--------- 1 file changed, 1 insertion(+), 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); -- cgit v1.2.1