components/apache2/patches/bug54719.patch
changeset 1346 ebb3e4503fed
parent 1345 ee87318d9935
child 1347 3b3de8ffd89f
equal deleted inserted replaced
1345:ee87318d9935 1346:ebb3e4503fed
     1 https://issues.apache.org/bugzilla/show_bug.cgi?id=54719
       
     2 
       
     3 --- server/log.c	2009-05-21 10:31:52.000000000 -0700
       
     4 +++ server/log.c	2013-04-03 02:34:41.324804956 -0700
       
     5 @@ -775,7 +775,7 @@ AP_DECLARE(void) ap_log_pid(apr_pool_t *
       
     6      static pid_t saved_pid = -1;
       
     7      pid_t mypid;
       
     8      apr_status_t rv;
       
     9 -    const char *fname;
       
    10 +    const char *fname, *dname;
       
    11  
       
    12      if (!filename) {
       
    13          return;
       
    14 @@ -804,6 +804,15 @@ AP_DECLARE(void) ap_log_pid(apr_pool_t *
       
    15                        fname);
       
    16      }
       
    17  
       
    18 +    dname = apr_pstrndup(p, filename, (strrchr(filename, '/')+1)-filename);
       
    19 +    if (APR_SUCCESS != (rv = apr_dir_make_recursive(dname,
       
    20 +            APR_OS_DEFAULT, p))) {
       
    21 +        ap_log_error(APLOG_MARK, APLOG_ERR, rv, NULL,
       
    22 +                     "could not create pid directory: %s",
       
    23 +                     dname);
       
    24 +        exit(1);
       
    25 +    }
       
    26 +
       
    27      if ((rv = apr_file_open(&pid_file, fname,
       
    28                              APR_WRITE | APR_CREATE | APR_TRUNCATE,
       
    29                              APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD, p))