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);
}
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
}
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);
}
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;
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;
/* 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);
/* 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);
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);
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
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;
}
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 */
}
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
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);
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");
{
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;
;
#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 {
--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;
}
/* 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?",
/* 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?",
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);
/* 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);