]> granicus.if.org Git - apache/commitdiff
Move away from DEFAULT_REL_RUNTIMEDIR and use ap_runtime_dir_relative()
authorJim Jagielski <jim@apache.org>
Mon, 12 Mar 2012 15:45:03 +0000 (15:45 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 12 Mar 2012 15:45:03 +0000 (15:45 +0000)
API

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

modules/cache/mod_socache_dbm.c
modules/cache/mod_socache_shmcb.c
modules/generators/mod_cgid.c
server/mpm/prefork/prefork.c
server/util_mutex.c

index 70fe28bf254e3f8e27e868f571c85a74f7deae36..0d7c302bafa031456cde978545ef0bb64a360cb8 100644 (file)
@@ -53,7 +53,7 @@ struct ap_socache_instance_t {
  */
 #define DBM_FILE_MODE ( APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD )
 
-#define DEFAULT_DBM_PREFIX DEFAULT_REL_RUNTIMEDIR "/socache-dbm-"
+#define DEFAULT_DBM_PREFIX "socache-dbm-"
 
 /* ### this should use apr_dbm_usednames. */
 #if !defined(DBM_FILE_SUFFIX_DIR) && !defined(DBM_FILE_SUFFIX_PAG)
@@ -127,7 +127,7 @@ static apr_status_t socache_dbm_init(ap_socache_instance_t *ctx,
         const char *path = apr_pstrcat(p, DEFAULT_DBM_PREFIX, namespace,
                                        NULL);
 
-        ctx->data_file = ap_server_root_relative(p, path);
+        ctx->data_file = ap_runtime_dir_relative(p, path);
 
         if (ctx->data_file == NULL) {
             ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(00803)
index ff4defd33807bc22fa252b62df937d17a62d55f8..4c892d07ce60e5118ca408cfcb06d460bd161986 100644 (file)
@@ -32,7 +32,7 @@
 
 #define SHMCB_MAX_SIZE (64 * 1024 * 1024)
 
-#define DEFAULT_SHMCB_PREFIX DEFAULT_REL_RUNTIMEDIR "/socache-shmcb-"
+#define DEFAULT_SHMCB_PREFIX "socache-shmcb-"
 
 #define DEFAULT_SHMCB_SUFFIX ".cache"
 
@@ -341,7 +341,7 @@ static apr_status_t socache_shmcb_init(ap_socache_instance_t *ctx,
         const char *path = apr_pstrcat(p, DEFAULT_SHMCB_PREFIX, namespace,
                                        DEFAULT_SHMCB_SUFFIX, NULL);
 
-        ctx->data_file = ap_server_root_relative(p, path);
+        ctx->data_file = ap_runtime_dir_relative(p, path);
     }
 
     /* Use anonymous shm by default, fall back on name-based. */
index 1e4aaf67afddbf16aa697205b4851a00ae371245..7a6540168c9d4824eec5522e06de4689bfe3d93c 100644 (file)
@@ -135,7 +135,7 @@ static int is_scriptaliased(request_rec *r)
 
 #define DEFAULT_LOGBYTES 10385760
 #define DEFAULT_BUFBYTES 1024
-#define DEFAULT_SOCKET  DEFAULT_REL_RUNTIMEDIR "/cgisock"
+#define DEFAULT_SOCKET "cgisock"
 
 #define CGI_REQ    1
 #define SSI_REQ    2
@@ -910,6 +910,7 @@ static int cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
         procnew->err = procnew->in = procnew->out = NULL;
         apr_pool_userdata_set((const void *)procnew, userdata_key,
                      apr_pool_cleanup_null, main_server->process->pool);
+        return ret;
     }
     else {
         procnew = data;
@@ -922,7 +923,7 @@ static int cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp,
             total_modules++;
 
         parent_pid = getpid();
-        tmp_sockname = ap_server_root_relative(p, sockname);
+        tmp_sockname = ap_runtime_dir_relative(p, sockname);
         if (strlen(tmp_sockname) > sizeof(server_addr->sun_path) - 1) {
             tmp_sockname[sizeof(server_addr->sun_path)] = '\0';
             ap_log_error(APLOG_MARK, APLOG_ERR, 0, main_server, APLOGNO(01254)
@@ -1016,7 +1017,7 @@ static const char *set_script_socket(cmd_parms *cmd, void *dummy, const char *ar
 
     /* Make sure the pid is appended to the sockname */
     sockname = ap_append_pid(cmd->pool, arg, ".");
-    sockname = ap_server_root_relative(cmd->pool, sockname);
+    sockname = ap_runtime_dir_relative(cmd->pool, sockname);
 
     if (!sockname) {
         return apr_pstrcat(cmd->pool, "Invalid ScriptSock path",
index 5de88e3254f1b1a2303843f7f6794b9fc09c43ab..471c8ff0bc5b5e4eea7a4a9378ac10efcf1233e9 100644 (file)
@@ -180,7 +180,7 @@ static void chdir_for_gprof(void)
         }
     }
     else {
-        use_dir = ap_server_root_relative(pconf, DEFAULT_REL_RUNTIMEDIR);
+        use_dir = ap_runtime_dir_relative(pconf, "");
     }
 
     chdir(use_dir);
index 0ff9483d214b76943c93beab1cb184d7e3935c35..e49cca5570e352cb49e2ddedddc522eafe87088a 100644 (file)
@@ -157,7 +157,7 @@ AP_DECLARE_NONSTD(void) ap_mutex_init(apr_pool_t *p)
     /* initialize default mutex configuration */
     def = apr_pcalloc(p, sizeof *def);
     def->mech = APR_LOCK_DEFAULT;
-    def->dir = DEFAULT_REL_RUNTIMEDIR;
+    def->dir = ap_runtime_dir_relative(p, "");
     apr_hash_set(mxcfg_by_type, "default", APR_HASH_KEY_STRING, def);
 }