]> granicus.if.org Git - apache/commitdiff
Cleanup the rest of the warnings that appear when compileing with
authorRyan Bloom <rbb@apache.org>
Sun, 11 Feb 2001 00:24:49 +0000 (00:24 +0000)
committerRyan Bloom <rbb@apache.org>
Sun, 11 Feb 2001 00:24:49 +0000 (00:24 +0000)
GRPOF.

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

server/mpm/prefork/prefork.c

index d2d9bba7a6f06aeae8952f2934177cd6a49d9a1f..fb7bd8365332bee42c41c42b4eeb6996cff04b8a 100644 (file)
@@ -193,22 +193,25 @@ static void chdir_for_gprof(void)
     core_server_config *sconf = 
        ap_get_module_config(ap_server_conf->module_config, &core_module);    
     char *dir = sconf->gprof_dir;
+    const char *use_dir;
 
     if(dir) {
+        apr_status_t res;
        char buf[512];
        int len = strlen(sconf->gprof_dir) - 1;
        if(*(dir + len) == '%') {
            dir[len] = '\0';
            apr_snprintf(buf, sizeof(buf), "%sgprof.%d", dir, (int)getpid());
        } 
-       dir = ap_server_root_relative(pconf, buf[0] ? buf : dir);
-       if(mkdir(dir, 0755) < 0 && errno != EEXIST) {
+       use_dir = ap_server_root_relative(pconf, buf[0] ? buf : dir);
+       res = apr_dir_make(use_dir, 0755, pconf);
+       if(res != APR_SUCCESS && !APR_STATUS_IS_EEXIST(res)) {
            ap_log_error(APLOG_MARK, APLOG_ERR, errno, ap_server_conf,
                         "gprof: error creating directory %s", dir);
        }
     }
     else {
-       dir = ap_server_root_relative(pconf, "logs");
+       use_dir = ap_server_root_relative(pconf, "logs");
     }
 
     chdir(dir);