]> granicus.if.org Git - apache/commitdiff
Fix some bad ap_log_error() invocations. Comment on a bad
authorJeff Trawick <trawick@apache.org>
Mon, 17 Jul 2000 22:11:47 +0000 (22:11 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 17 Jul 2000 22:11:47 +0000 (22:11 +0000)
ap_log_rerror() invocation.

Almost all of this is in code never compiled.

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

modules/filters/mod_include.c
modules/proxy/mod_proxy.c
os/bs2000/bs2login.c
os/tpf/os.c
os/unix/unixd.c
server/connection.c
server/mpm/mpmt_pthread/mpmt_pthread.c
server/util.c
server/util_uri.c

index 95283bee4cece13a2aedcd24231e9c2db57124a1..ad9cf916a9c3ebc2f361a9b45794e8b0eb94d2cc 100644 (file)
@@ -1139,6 +1139,9 @@ static int find_file(request_rec *r, const char *directive, const char *tag,
 
         if (error_fmt) {
             ret = -1;
+            /* TODO: pass APLOG_NOERRNO if no ap_stat() failure; pass rv from ap_stat()
+             * otherwise
+             */
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, error_fmt, to_send, r->filename);
             ap_rputs(error, r);
         }
index 773d019e86d478c90d11aa2986a0e39692d1cf35..8ab28367408e4945f86fdd667111ed2a2ab80709 100644 (file)
@@ -644,30 +644,30 @@ static const char *
 
     if (ap_proxy_is_ipaddr(New, parms->pool)) {
 #if DEBUGGING
-        ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, 0, NULL, 
+        ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
                          "Parsed addr %s", inet_ntoa(New->addr));
-        ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, 0, NULL, 
+        ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
                          "Parsed mask %s", inet_ntoa(New->mask));
 #endif
     }
     else if (ap_proxy_is_domainname(New, parms->pool)) {
         ap_str_tolower(New->name);
 #if DEBUGGING
-        ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, 0, NULL, 
+        ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
                          "Parsed domain %s", New->name);
 #endif
     }
     else if (ap_proxy_is_hostname(New, parms->pool)) {
         ap_str_tolower(New->name);
 #if DEBUGGING
-        ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, 0, NULL, 
+        ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
                          "Parsed host %s", New->name);
 #endif
     }
     else {
         ap_proxy_is_word(New, parms->pool);
 #if DEBUGGING
-        ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, 0, NULL, 
+        ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
                          "Parsed word %s", New->name);
 #endif
     }
index 9f5483c0fdac87ff3881d719fbf40575c3f23fed..38ef902747d1581b85978458d95a634c089cb7c3 100644 (file)
@@ -119,7 +119,7 @@ static bs2_ForkType os_forktype(void)
 
     if (uname(&os_version) < 0)
     {
-       ap_log_error(APLOG_MARK, APLOG_ALERT, NULL,
+       ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
                     "uname() failed - aborting.");
        exit(APEXIT_CHILDFATAL);
     }
@@ -132,7 +132,7 @@ static bs2_ForkType os_forktype(void)
        strcmp(os_version.release, "02.0A") == 0 ||
        strcmp(os_version.release, "02.1A") == 0)
     {
-       ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, NULL,
+       ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, NULL,
                     "Error: unsupported OS version. "
                     "You may encounter problems.");
        forktype = bs2_FORK;
@@ -207,7 +207,7 @@ int os_init_job_environment(server_rec *server, const char *user_name, int one_p
 
        type = forktype = bs2_noFORK;
 
-       ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, server,
+       ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, server,
                     "The debug mode of Apache should only "
                     "be started by an unprivileged user!");
        return 0;
@@ -220,7 +220,7 @@ int os_init_job_environment(server_rec *server, const char *user_name, int one_p
     /* An Account is required for _rini() */
     if (bs2000_account == NULL)
     {
-       ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, server,
+       ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, 0, server,
                     "No BS2000Account configured - cannot switch to User %s",
                     user_name);
        exit(APEXIT_CHILDFATAL);
@@ -242,7 +242,7 @@ int os_init_job_environment(server_rec *server, const char *user_name, int one_p
     /* Only the super user can switch identities. */
     if (_rini(&inittask) != 0) {
 
-       ap_log_error(APLOG_MARK, APLOG_ALERT, server,
+       ap_log_error(APLOG_MARK, APLOG_ALERT, errno, server,
                     "_rini: BS2000 auth failed for user \"%s\" acct \"%s\"",
                     inittask.username, inittask.account);
 
@@ -276,7 +276,7 @@ pid_t os_fork(const char *user)
 
        pid = ufork(username);
        if (pid == -1 && errno == EPERM) {
-           ap_log_error(APLOG_MARK, APLOG_EMERG,
+           ap_log_error(APLOG_MARK, APLOG_EMERG, errno,
                         NULL, "ufork: Possible mis-configuration "
                         "for user %s - Aborting.", user);
            exit(1);
index 5cd9df4ae9c271391c3ca79197d4f6e3a645023d..246b0a4f060ac536f68cfd90ce50cc338239d83c 100644 (file)
@@ -349,11 +349,11 @@ pid_t os_fork(server_rec *s, int slot)
 
     fflush(stdin);
     if (dup2(fileno(sock_fp), STDIN_FILENO) == -1)
-        ap_log_error(APLOG_MARK, APLOG_CRIT, s,
+        ap_log_error(APLOG_MARK, APLOG_CRIT, errno, s,
         "unable to replace stdin with sock device driver");
     fflush(stdout);
     if (dup2(fileno(sock_fp), STDOUT_FILENO) == -1)
-        ap_log_error(APLOG_MARK, APLOG_CRIT, s,
+        ap_log_error(APLOG_MARK, APLOG_CRIT, errno, s,
         "unable to replace stdout with sock device driver");
     input_parms.generation = ap_my_generation;
 #ifdef SCOREBOARD_FILE
index bc0153e7f76b2d6736ce4e622d55a1dbf69e57fe..0253fda0d4c679826998bfbc60d64c3e77f9f5ef 100644 (file)
@@ -353,7 +353,7 @@ API_EXPORT(void) unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit,
     limit = *plimit;
     if ((getrlimit(type, limit)) != 0)  {
         *plimit = NULL;
-        ap_log_error(APLOG_MARK, APLOG_ERR, 0, cmd->server,
+        ap_log_error(APLOG_MARK, APLOG_ERR, errno, cmd->server,
                      "%s: getrlimit failed", cmd->cmd->name);
         return;
     }
index 1d20ee463c30b152b9b191463f11fa49fcbaed6a..c975038ee87fd7024d8578b23bfa3efbb3e0a85e 100644 (file)
@@ -118,7 +118,7 @@ static void sock_enable_linger(int s)
 
     if (setsockopt(s, SOL_SOCKET, SO_LINGER, 
                   (char *) &li, sizeof(struct linger)) < 0) {
-       ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf,
+       ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf,
                    "setsockopt: (SO_LINGER)");
        /* not a fatal error */
     }
index 4d24efce6c9d8720b0ca09b6b08f4a2a5fc63a85..dbece3e21b75d65d601a2856cd8954e2827e0499 100644 (file)
@@ -761,7 +761,7 @@ static int make_child(server_rec *s, int slot, time_t now)
         int status = bindprocessor(BINDPROCESS, (int)getpid(),
                               PROCESSOR_CLASS_ANY);
        if (status != OK)
-           ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, ap_server_conf,
+           ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, errno, ap_server_conf,
                         "processor unbind failed %d", status);
 #endif
 
index 1bab22d7be5229b63153e4a3f74006ca4b620733..09e9758335f1e924fa3fb21d175fac4efe998c8a 100644 (file)
@@ -824,7 +824,7 @@ API_EXPORT(const char *) ap_resolve_env(ap_pool_t *p, const char * word)
 API_EXPORT(int) ap_cfg_closefile(configfile_t *cfp)
 {
 #ifdef DEBUG
-    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, 
+    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, NULL, 
         "Done with config file %s", cfp->name);
 #endif
     return (cfp->close == NULL) ? 0 : cfp->close(cfp->param);
@@ -879,7 +879,7 @@ API_EXPORT(ap_status_t) ap_pcfg_openfile(configfile_t **ret_cfg, ap_pool_t *p, c
 
     status = ap_open(&file, name, APR_READ | APR_BUFFERED, APR_OS_DEFAULT, p);
 #ifdef DEBUG
-    ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, NULL,
+    ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, NULL,
                 "Opening config file %s (%s)",
                 name, (status != APR_SUCCESS) ? 
                 ap_strerror(status, buf, sizeof(buf)) : "successful");
@@ -927,7 +927,7 @@ API_EXPORT(configfile_t *) ap_pcfg_open_custom(ap_pool_t *p, const char *descr,
 {
     configfile_t *new_cfg = ap_palloc(p, sizeof(*new_cfg));
 #ifdef DEBUG
-    ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, NULL, "Opening config handler %s", descr);
+    ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, NULL, "Opening config handler %s", descr);
 #endif
     new_cfg->param = param;
     new_cfg->name = descr;
@@ -1016,7 +1016,7 @@ API_EXPORT(int) ap_cfg_getline(char *buf, size_t bufsize, configfile_t *cfp)
                ;
 
 #ifdef DEBUG_CFG_LINES
-       ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Read config: %s", buf);
+       ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, NULL, "Read config: %s", buf);
 #endif
        return 0;
     } else {
@@ -1073,7 +1073,7 @@ API_EXPORT(int) ap_cfg_getline(char *buf, size_t bufsize, configfile_t *cfp)
                    --i;
                buf[i] = '\0';
 #ifdef DEBUG_CFG_LINES
-               ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Read config: %s", buf);
+               ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, NULL, "Read config: %s", buf);
 #endif
                return 0;
            }
index bef8108e2e2a61d3e9fb9ee7aabb9690a44583ea..6d6a39bd569fbf0c2b03b253d395c68f73431cad 100644 (file)
@@ -272,7 +272,7 @@ API_EXPORT(void) ap_util_uri_init(void)
 
        /* Make a readable error message */
        ret = regerror(ret, &re_uri, line, sizeof line);
-       ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL,
+       ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, NULL,
                "Internal error: regcomp(\"%s\") returned non-zero (%s) - "
                "possibly due to broken regex lib! "
                "Did you define WANTHSREGEX=yes?",
@@ -291,7 +291,7 @@ API_EXPORT(void) ap_util_uri_init(void)
 
        /* Make a readable error message */
        ret = regerror(ret, &re_hostpart, line, sizeof line);
-       ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL,
+       ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, NULL,
                "Internal error: regcomp(\"%s\") returned non-zero (%s) - "
                "possibly due to broken regex lib! "
                "Did you define WANTHSREGEX=yes?",
@@ -327,7 +327,7 @@ API_EXPORT(int) ap_parse_uri_components(ap_pool_t *p, const char *uri, uri_compo
     ret = ap_regexec(&re_uri, uri, re_uri.re_nsub + 1, match, 0);
 
     if (ret != 0) {
-       ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL,
+       ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, NULL,
                     "ap_regexec() could not parse uri (\"%s\")",
                    uri);
 
@@ -356,7 +356,7 @@ API_EXPORT(int) ap_parse_uri_components(ap_pool_t *p, const char *uri, uri_compo
        /* Parse the hostinfo part to extract user, password, host, and port */
        ret = ap_regexec(&re_hostpart, uptr->hostinfo, re_hostpart.re_nsub + 1, match, 0);
        if (ret != 0) {
-           ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL,
+           ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, NULL,
                     "ap_regexec() could not parse (\"%s\") as host part",
                    uptr->hostinfo);