Commit 478fa00d authored by Ryan Bloom's avatar Ryan Bloom
Browse files

Cleanup the rest of the warnings that appear when compileing with

GRPOF.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88078 13f79535-47bb-0310-9956-ffa450edef68
parent a0c1cb27
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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);