]> granicus.if.org Git - apache/commitdiff
* server/config.c (process_resource_config_nofnmatch): Fail with
authorJoe Orton <jorton@apache.org>
Tue, 3 May 2005 19:41:02 +0000 (19:41 +0000)
committerJoe Orton <jorton@apache.org>
Tue, 3 May 2005 19:41:02 +0000 (19:41 +0000)
useful error message if the config file can't be opened.

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

server/config.c

index ce680c926d7fcb2cbfa75aa98bd7e1a2cbae53a7..71e8a8d60eca3d5093898c7bfd2f468d87addcff 100644 (file)
@@ -1429,6 +1429,7 @@ static const char *process_resource_config_nofnmatch(server_rec *s,
     cmd_parms parms;
     ap_configfile_t *cfp;
     const char *error;
+    apr_status_t rv;
 
     if (ap_is_directory(p, fname)) {
         apr_dir_t *dirp;
@@ -1436,7 +1437,6 @@ static const char *process_resource_config_nofnmatch(server_rec *s,
         int current;
         apr_array_header_t *candidates = NULL;
         fnames *fnew;
-        apr_status_t rv;
         char *path = apr_pstrdup(p, fname);
 
         if (++depth > AP_MAX_INCLUDE_DIR_DEPTH) {
@@ -1499,9 +1499,11 @@ static const char *process_resource_config_nofnmatch(server_rec *s,
     parms.override = (RSRC_CONF | OR_ALL) & ~(OR_AUTHCFG | OR_LIMIT);
     parms.override_opts = OPT_ALL | OPT_INCNOEXEC | OPT_SYM_OWNER | OPT_MULTI;
 
-    if (ap_pcfg_openfile(&cfp, p, fname) != APR_SUCCESS) {
-        return apr_pstrcat(p, "Could not open document config file ",
-                           fname, NULL);
+    rv = ap_pcfg_openfile(&cfp, p, fname); 
+    if (rv != APR_SUCCESS) {
+        char errmsg[120];
+        return apr_psprintf(p, "Could not open configuration file %s: %s",
+                            fname, apr_strerror(rv, errmsg, sizeof errmsg));
     }
 
     parms.config_file = cfp;