From 5acededcd6cab17dff2427f5cb5dcb1010f81a9f Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 25 Nov 2016 09:12:59 -0500 Subject: [PATCH] ... --- MagickCore/utility.c | 16 +++++++--------- config/config.h.in | 3 --- configure | 4 ++-- configure.ac | 2 +- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/MagickCore/utility.c b/MagickCore/utility.c index 47b4578f1..9e4496138 100644 --- a/MagickCore/utility.c +++ b/MagickCore/utility.c @@ -1152,9 +1152,9 @@ MagickExport MagickBooleanType GetPathAttributes(const char *path, { MagickBooleanType status; - + if (path == (const char *) NULL) - { + { errno=EINVAL; return(MagickFalse); } @@ -1568,14 +1568,12 @@ static int FileCompare(const void *x,const void *y) static inline int MagickReadDirectory(DIR *directory,struct dirent *entry, struct dirent **result) { -#if defined(MAGICKCORE_HAVE_READDIR_R) - return(readdir_r(directory,entry,result)); -#else - (void) entry; errno=0; - *result=readdir(directory); - return(errno); -#endif + entry=readdir(directory); + *result=entry; + if ((entry == (struct dirent *) NULL) && (errno != 0)) + return(-1); + return(0); } MagickPrivate char **ListFiles(const char *directory,const char *pattern, diff --git a/config/config.h.in b/config/config.h.in index e4102ec71..f800fd952 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -393,9 +393,6 @@ /* Define to 1 if you have the `rand_r' function. */ #undef HAVE_RAND_R -/* Define to 1 if you have the `readdir_r' function. */ -#undef HAVE_READDIR_R - /* Define to 1 if you have the `readlink' function. */ #undef HAVE_READLINK diff --git a/configure b/configure index cd14dea70..3102227f6 100755 --- a/configure +++ b/configure @@ -4518,7 +4518,7 @@ MAGICK_PATCHLEVEL_VERSION=8 MAGICK_VERSION=7.0.3-8 -MAGICK_GIT_REVISION=19065:635ae10:20161125 +MAGICK_GIT_REVISION=19066:6f0fe5e:20161125 # Substitute library versioning @@ -27862,7 +27862,7 @@ $as_echo "#define HAVE_SOCKET 1" >>confdefs.h fi -for ac_func in acosh _aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock clock_getres clock_gettime ctime_r directio erf _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir sendfile setlocale socket sqrt setvbuf stat strchr strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat +for ac_func in acosh _aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock clock_getres clock_gettime ctime_r directio erf _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink realpath select seekdir sendfile setlocale socket sqrt setvbuf stat strchr strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/configure.ac b/configure.ac index 300e58bd6..1997a9a0d 100644 --- a/configure.ac +++ b/configure.ac @@ -1218,7 +1218,7 @@ AC_SEARCH_LIBS(socket, socket, MAGICK_FEATURES="DPC $MAGICK_FEATURES" ]) -AC_CHECK_FUNCS([acosh _aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock clock_getres clock_gettime ctime_r directio erf _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir sendfile setlocale socket sqrt setvbuf stat strchr strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat]) +AC_CHECK_FUNCS([acosh _aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock clock_getres clock_gettime ctime_r directio erf _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink realpath select seekdir sendfile setlocale socket sqrt setvbuf stat strchr strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat]) # # Check for clock_gettime(). -- 2.40.0