apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r291973 - in /apr/apr/trunk: file_io/unix/dir.c include/arch/unix/apr_arch_file_io.h
Date Tue, 27 Sep 2005 15:14:43 GMT
Author: jorton
Date: Tue Sep 27 08:14:37 2005
New Revision: 291973

URL: http://svn.apache.org/viewcvs?rev=291973&view=rev
Log:
* include/arch/unix/apr_arch_file_io.h: Define APR_USE_READDIR64_R to
avoid cases where readdir() is used in place of readdir_r even if
readdir64_r is available.

* file_io/unix/dir.c (apr_dir_read): Use APR_USE_READDIR64_R.

Modified:
    apr/apr/trunk/file_io/unix/dir.c
    apr/apr/trunk/include/arch/unix/apr_arch_file_io.h

Modified: apr/apr/trunk/file_io/unix/dir.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/file_io/unix/dir.c?rev=291973&r1=291972&r2=291973&view=diff
==============================================================================
--- apr/apr/trunk/file_io/unix/dir.c (original)
+++ apr/apr/trunk/file_io/unix/dir.c Tue Sep 27 08:14:37 2005
@@ -139,7 +139,7 @@
 #endif
 #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
                     && !defined(READDIR_IS_THREAD_SAFE)
-#ifdef HAVE_READDIR64_R
+#ifdef APR_USE_READDIR64_R
     struct dirent64 *retent;
 
     /* If LFS is enabled and readdir64_r is available, readdir64_r is
@@ -210,7 +210,7 @@
 #endif
 #ifdef DIRENT_INODE
     if (thedir->entry->DIRENT_INODE && thedir->entry->DIRENT_INODE !=
-1) {
-#ifdef HAVE_READDIR64_R
+#ifdef APR_USE_READDIR64_R
         /* If readdir64_r is used, check for the overflow case of trying
          * to fit a 64-bit integer into a 32-bit integer. */
         if (sizeof(apr_ino_t) >= sizeof(retent->DIRENT_INODE)
@@ -223,7 +223,7 @@
         }
 #else
         wanted &= ~APR_FINFO_INODE;
-#endif /* HAVE_READDIR64_R */
+#endif /* APR_USE_READDIR64_R */
     }
 #endif /* DIRENT_INODE */
 

Modified: apr/apr/trunk/include/arch/unix/apr_arch_file_io.h
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/include/arch/unix/apr_arch_file_io.h?rev=291973&r1=291972&r2=291973&view=diff
==============================================================================
--- apr/apr/trunk/include/arch/unix/apr_arch_file_io.h (original)
+++ apr/apr/trunk/include/arch/unix/apr_arch_file_io.h Tue Sep 27 08:14:37 2005
@@ -121,11 +121,17 @@
 typedef struct stat struct_stat;
 #endif
 
+/* readdir64_r is only used in specific cases: */
+#if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
+    && !defined(READDIR_IS_THREAD_SAFE) && defined(HAVE_READDIR64_R)
+#define APR_USE_READDIR64_R
+#endif
+
 struct apr_dir_t {
     apr_pool_t *pool;
     char *dirname;
     DIR *dirstruct;
-#ifdef HAVE_READDIR64_R
+#ifdef APR_USE_READDIR64_R
     struct dirent64 *entry;
 #else
     struct dirent *entry;



Mime
View raw message