summaryrefslogtreecommitdiff
path: root/server/config.c
diff options
context:
space:
mode:
authorJim Jagielski <jim@apache.org>2012-03-07 12:31:58 +0000
committerJim Jagielski <jim@apache.org>2012-03-07 12:31:58 +0000
commitfc1b444d2e58ab23abff08fa379cd455e78004ff (patch)
treeed0402db9000f20a877aa882794a6739f93f7dbc /server/config.c
parent5f545146f6cd788c0364291247c514af742a7b44 (diff)
downloadhttpd-fc1b444d2e58ab23abff08fa379cd455e78004ff.tar.gz
Fold on Jeff's DefaultRuntimeDir impl... docs on the way
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1297955 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/config.c')
-rw-r--r--server/config.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/server/config.c b/server/config.c
index 96ab9c9d57..7585704682 100644
--- a/server/config.c
+++ b/server/config.c
@@ -59,6 +59,7 @@
AP_DECLARE_DATA const char *ap_server_argv0 = NULL;
AP_DECLARE_DATA const char *ap_server_root = NULL;
+AP_DECLARE_DATA const char *ap_runtime_dir = NULL;
AP_DECLARE_DATA server_rec *ap_server_conf = NULL;
AP_DECLARE_DATA apr_pool_t *ap_pglobal = NULL;
@@ -1560,6 +1561,25 @@ AP_DECLARE(char *) ap_server_root_relative(apr_pool_t *p, const char *file)
}
}
+AP_DECLARE(char *) ap_runtime_dir_relative(apr_pool_t *p, const char *file)
+{
+ char *newpath = NULL;
+ apr_status_t rv;
+ const char *runtime_dir = ap_runtime_dir ? ap_runtime_dir : ap_server_root_relative(p, DEFAULT_REL_RUNTIMEDIR);
+
+ rv = apr_filepath_merge(&newpath, runtime_dir, file,
+ APR_FILEPATH_TRUENAME, p);
+ if (newpath && (rv == APR_SUCCESS || APR_STATUS_IS_EPATHWILD(rv)
+ || APR_STATUS_IS_ENOENT(rv)
+ || APR_STATUS_IS_ENOTDIR(rv))) {
+ return newpath;
+ }
+ else {
+ return NULL;
+ }
+}
+
+
AP_DECLARE(const char *) ap_soak_end_container(cmd_parms *cmd, char *directive)
{
struct ap_varbuf vb;