apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r917837 - in /apr/apr/trunk: buckets/apr_buckets_file.c dbm/apr_dbm_sdbm.c dbm/sdbm/sdbm.c include/arch/unix/apr_arch_inherit.h locks/unix/proc_mutex.c shmem/unix/shm.c
Date Tue, 02 Mar 2010 01:27:43 GMT
Author: minfrin
Date: Tue Mar  2 01:27:42 2010
New Revision: 917837

URL: http://svn.apache.org/viewvc?rev=917837&view=rev
Log:
Use the APR_FOPEN_* constants instead of the deprecated APR_* constants
within code outside the file_io code.

Modified:
    apr/apr/trunk/buckets/apr_buckets_file.c
    apr/apr/trunk/dbm/apr_dbm_sdbm.c
    apr/apr/trunk/dbm/sdbm/sdbm.c
    apr/apr/trunk/include/arch/unix/apr_arch_inherit.h
    apr/apr/trunk/locks/unix/proc_mutex.c
    apr/apr/trunk/shmem/unix/shm.c

Modified: apr/apr/trunk/buckets/apr_buckets_file.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/buckets/apr_buckets_file.c?rev=917837&r1=917836&r2=917837&view=diff
==============================================================================
--- apr/apr/trunk/buckets/apr_buckets_file.c (original)
+++ apr/apr/trunk/buckets/apr_buckets_file.c Tue Mar  2 01:27:42 2010
@@ -93,14 +93,14 @@
 #endif
 
 #if APR_HAS_THREADS && !APR_HAS_XTHREAD_FILES
-    if ((flags = apr_file_flags_get(f)) & APR_XTHREAD) {
+    if ((flags = apr_file_flags_get(f)) & APR_FOPEN_XTHREAD) {
         /* this file descriptor is shared across multiple threads and
          * this OS doesn't support that natively, so as a workaround
          * we must reopen the file into a->readpool */
         const char *fname;
         apr_file_name_get(&fname, f);
 
-        rv = apr_file_open(&f, fname, (flags & ~APR_XTHREAD), 0, a->readpool);
+        rv = apr_file_open(&f, fname, (flags & ~APR_FOPEN_XTHREAD), 0, a->readpool);
         if (rv != APR_SUCCESS)
             return rv;
 

Modified: apr/apr/trunk/dbm/apr_dbm_sdbm.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/dbm/apr_dbm_sdbm.c?rev=917837&r1=917836&r2=917837&view=diff
==============================================================================
--- apr/apr/trunk/dbm/apr_dbm_sdbm.c (original)
+++ apr/apr/trunk/dbm/apr_dbm_sdbm.c Tue Mar  2 01:27:42 2010
@@ -27,11 +27,11 @@
 #include "apr_dbm_private.h"
 #include "apr_sdbm.h"
 
-#define APR_DBM_DBMODE_RO       (APR_READ | APR_BUFFERED)
-#define APR_DBM_DBMODE_RW       (APR_READ | APR_WRITE)
-#define APR_DBM_DBMODE_RWCREATE (APR_READ | APR_WRITE | APR_CREATE)
-#define APR_DBM_DBMODE_RWTRUNC  (APR_READ | APR_WRITE | APR_CREATE | \
-                                 APR_TRUNCATE)
+#define APR_DBM_DBMODE_RO       (APR_FOPEN_READ | APR_FOPEN_BUFFERED)
+#define APR_DBM_DBMODE_RW       (APR_FOPEN_READ | APR_FOPEN_WRITE)
+#define APR_DBM_DBMODE_RWCREATE (APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE)
+#define APR_DBM_DBMODE_RWTRUNC  (APR_FOPEN_READ | APR_FOPEN_WRITE | APR_FOPEN_CREATE | \
+                                 APR_FOPEN_TRUNCATE)
 
 static apr_status_t set_error(apr_dbm_t *dbm, apr_status_t dbm_said)
 {

Modified: apr/apr/trunk/dbm/sdbm/sdbm.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/dbm/sdbm/sdbm.c?rev=917837&r1=917836&r2=917837&view=diff
==============================================================================
--- apr/apr/trunk/dbm/sdbm/sdbm.c (original)
+++ apr/apr/trunk/dbm/sdbm/sdbm.c Tue Mar  2 01:27:42 2010
@@ -101,7 +101,7 @@
      * as required by this package. Also set our internal
      * flag for RDONLY if needed.
      */
-    if (!(flags & APR_WRITE)) {
+    if (!(flags & APR_FOPEN_WRITE)) {
         db->flags |= SDBM_RDONLY;
     }
 
@@ -111,12 +111,12 @@
      * an apr_file_t, in case it's ever introduced, and set
      * our own flag.
      */
-    if (flags & APR_SHARELOCK) {
+    if (flags & APR_FOPEN_SHARELOCK) {
         db->flags |= SDBM_SHARED;
-        flags &= ~APR_SHARELOCK;
+        flags &= ~APR_FOPEN_SHARELOCK;
     }
 
-    flags |= APR_BINARY | APR_READ;
+    flags |= APR_FOPEN_BINARY | APR_FOPEN_READ;
 
     /*
      * open the files in sequence, and stat the dirfile.

Modified: apr/apr/trunk/include/arch/unix/apr_arch_inherit.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/arch/unix/apr_arch_inherit.h?rev=917837&r1=917836&r2=917837&view=diff
==============================================================================
--- apr/apr/trunk/include/arch/unix/apr_arch_inherit.h (original)
+++ apr/apr/trunk/include/arch/unix/apr_arch_inherit.h Tue Mar  2 01:27:42 2010
@@ -24,7 +24,7 @@
 #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup)        \
 apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name)    \
 {                                                                   \
-    if (the##name->flag & APR_FILE_NOCLEANUP)                       \
+    if (the##name->flag & APR_FOPEN_NOCLEANUP)                      \
         return APR_EINVAL;                                          \
     if (!(the##name->flag & APR_INHERIT)) {                         \
         int flags = fcntl(the##name->name##des, F_GETFD);           \
@@ -44,7 +44,7 @@
 #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup)      \
 apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name)  \
 {                                                                   \
-    if (the##name->flag & APR_FILE_NOCLEANUP)                       \
+    if (the##name->flag & APR_FOPEN_NOCLEANUP)                      \
         return APR_EINVAL;                                          \
     if (the##name->flag & APR_INHERIT) {                            \
         int flags;                                                  \

Modified: apr/apr/trunk/locks/unix/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/locks/unix/proc_mutex.c?rev=917837&r1=917836&r2=917837&view=diff
==============================================================================
--- apr/apr/trunk/locks/unix/proc_mutex.c (original)
+++ apr/apr/trunk/locks/unix/proc_mutex.c Tue Mar  2 01:27:42 2010
@@ -569,14 +569,14 @@
     if (fname) {
         new_mutex->fname = apr_pstrdup(new_mutex->pool, fname);
         rv = apr_file_open(&new_mutex->interproc, new_mutex->fname,
-                           APR_CREATE | APR_WRITE | APR_EXCL, 
+                           APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_EXCL,
                            APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD,
                            new_mutex->pool);
     }
     else {
         new_mutex->fname = apr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX");
         rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname,
-                             APR_CREATE | APR_WRITE | APR_EXCL,
+                             APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_EXCL,
                              new_mutex->pool);
     }
  
@@ -706,14 +706,14 @@
     if (fname) {
         new_mutex->fname = apr_pstrdup(new_mutex->pool, fname);
         rv = apr_file_open(&new_mutex->interproc, new_mutex->fname,
-                           APR_CREATE | APR_WRITE | APR_EXCL, 
+                           APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_EXCL,
                            APR_UREAD | APR_UWRITE,
                            new_mutex->pool);
     }
     else {
         new_mutex->fname = apr_pstrdup(new_mutex->pool, "/tmp/aprXXXXXX");
         rv = apr_file_mktemp(&new_mutex->interproc, new_mutex->fname,
-                             APR_CREATE | APR_WRITE | APR_EXCL,
+                             APR_FOPEN_CREATE | APR_FOPEN_WRITE | APR_FOPEN_EXCL,
                              new_mutex->pool);
     }
  
@@ -789,7 +789,7 @@
     }
     new_mutex->fname = apr_pstrdup(pool, fname);
     rv = apr_file_open(&new_mutex->interproc, new_mutex->fname,
-                       APR_WRITE, 0, new_mutex->pool);
+                       APR_FOPEN_WRITE, 0, new_mutex->pool);
     if (rv != APR_SUCCESS) {
         return rv;
     }

Modified: apr/apr/trunk/shmem/unix/shm.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/shmem/unix/shm.c?rev=917837&r1=917836&r2=917837&view=diff
==============================================================================
--- apr/apr/trunk/shmem/unix/shm.c (original)
+++ apr/apr/trunk/shmem/unix/shm.c Tue Mar  2 01:27:42 2010
@@ -304,7 +304,7 @@
 
         /* FIXME: APR_OS_DEFAULT is too permissive, switch to 600 I think. */
         status = apr_file_open(&file, filename, 
-                               APR_WRITE | APR_CREATE | APR_EXCL,
+                               APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_EXCL,
                                APR_OS_DEFAULT, pool);
         if (status != APR_SUCCESS) {
             return status;
@@ -384,7 +384,7 @@
     return APR_SUCCESS;
 #elif APR_USE_SHMEM_SHMGET
     /* Presume that the file already exists; just open for writing */    
-    status = apr_file_open(&file, filename, APR_WRITE,
+    status = apr_file_open(&file, filename, APR_FOPEN_WRITE,
                            APR_OS_DEFAULT, pool);
     if (status) {
         return status;
@@ -527,7 +527,7 @@
         new_m = apr_palloc(pool, sizeof(apr_shm_t));
 
         status = apr_file_open(&file, filename, 
-                               APR_READ, APR_OS_DEFAULT, pool);
+                               APR_FOPEN_READ, APR_OS_DEFAULT, pool);
         if (status != APR_SUCCESS) {
             return status;
         }



Mime
View raw message