]> granicus.if.org Git - apache/blobdiff - support/htcacheclean.c
Make sure the pidfile is deleted on close.
[apache] / support / htcacheclean.c
index 5c6378b68d48e6452f79d8b0f7c2f8cc31eba987..43d5117dd2f021916e592b32c50fe0e9d468f428 100644 (file)
@@ -972,10 +972,9 @@ int main(int argc, const char * const argv[])
         apr_file_t *file;
         pid_t mypid = getpid();
         if (APR_SUCCESS == (status = apr_file_open(&file, pidfile, APR_WRITE
-                | APR_CREATE | APR_TRUNCATE,
+                | APR_CREATE | APR_TRUNCATE | APR_DELONCLOSE,
                 APR_UREAD | APR_UWRITE | APR_GREAD, pool))) {
             apr_file_printf(file, "%" APR_PID_T_FMT APR_EOL_STR, mypid);
-            apr_file_close(file);
         }
         else if (!isdaemon) {
             apr_file_printf(errfile,