Commit 26dd542f authored by Bill Stoddard's avatar Bill Stoddard
Browse files

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
parent 66346117
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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",