]> granicus.if.org Git - apache/commitdiff
Add a new function ap_set_default_fperms. This allows people to set the
authorRyan Bloom <rbb@apache.org>
Mon, 12 Jun 2000 16:00:33 +0000 (16:00 +0000)
committerRyan Bloom <rbb@apache.org>
Mon, 12 Jun 2000 16:00:33 +0000 (16:00 +0000)
umask to be used when creating files.  This should change the permissions
of files created using APR_DEFAULT_OS.  Also removed a warning introduced
with the sys/stat.h changes.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85537 13f79535-47bb-0310-9956-ffa450edef68

server/log.c

index 9e8d6c93ed562b85f8fd64a32e3824f0868a6a16..11dd2f1b19e8889c1159146e594838ff0b547ab4 100644 (file)
@@ -515,8 +515,8 @@ void ap_log_pid(ap_pool_t *p, const char *fname)
     }
 
 #ifndef WIN32
-    u = umask(022);
-    (void) umask(u | 022);
+    u = ap_set_default_fperms(022);
+    (void) ap_set_default_fperms(u | 022);
 #endif
     if (ap_open(&pid_file, fname, APR_WRITE | APR_CREATE | APR_TRUNCATE,
                 APR_OS_DEFAULT, p) != APR_SUCCESS) {
@@ -527,7 +527,7 @@ void ap_log_pid(ap_pool_t *p, const char *fname)
         exit(1);
     }
 #ifndef WIN32
-    (void) umask(u);
+    (void) ap_set_default_fperms(u);
 #endif
     ap_fprintf(pid_file, "%ld\n", (long)mypid);
     ap_close(pid_file);