]> granicus.if.org Git - apache/commitdiff
Tell APR to truncate the httpd.pid file if it exists. Fix a bug in the
authorBill Stoddard <stoddard@apache.org>
Tue, 25 Apr 2000 23:15:46 +0000 (23:15 +0000)
committerBill Stoddard <stoddard@apache.org>
Tue, 25 Apr 2000 23:15:46 +0000 (23:15 +0000)
Windows side of APR to correctly handle this flag. Also fix related bug
in ap_write.

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

server/log.c

index 3139e24c72cb6ff4f7a4fcc6c06071683b390584..1f540ed0d455a1ab2ae228f9fd34c71631750519 100644 (file)
@@ -527,7 +527,8 @@ void ap_log_pid(ap_pool_t *p, const char *fname)
     u = umask(022);
     (void) umask(u | 022);
 #endif
-    if(ap_open(&pid_file, fname, APR_WRITE | APR_CREATE, APR_OS_DEFAULT, p) != APR_SUCCESS) {
+    if (ap_open(&pid_file, fname, APR_WRITE | APR_CREATE | APR_TRUNCATE,
+                APR_OS_DEFAULT, p) != APR_SUCCESS) {
        perror("fopen");
         ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
                      "%s: could not log pid to file %s",