From: Bill Stoddard Date: Tue, 25 Apr 2000 23:15:46 +0000 (+0000) Subject: Tell APR to truncate the httpd.pid file if it exists. Fix a bug in the X-Git-Tag: APACHE_2_0_ALPHA_3~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=385effc089bbe9b432a30a3e3c5e201c6e20e37b;p=apache Tell APR to truncate the httpd.pid file if it exists. Fix a bug in the 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 --- diff --git a/server/log.c b/server/log.c index 3139e24c72..1f540ed0d4 100644 --- a/server/log.c +++ b/server/log.c @@ -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",