#ifdef HAVE_SHMEM_MM
static ap_status_t cleanup_tables(void *not_used)
{
- fprintf(stderr, "Digest: cleaning up shared memory\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Digest: cleaning up shared memory");
fflush(stderr);
if (client_mm) {
ap_status_t status = ap_getc(&c, f); \
if (status != APR_SUCCESS) { /* either EOF or error -- needs error handling if latter */ \
if (status != APR_EOF) { \
- fprintf(stderr, "encountered error in GET_CHAR macro, " \
- "mod_include.\n"); \
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, \
+ "encountered error in GET_CHAR macro, " \
+ "mod_include."); \
} \
FLUSH_BUF(r); \
ap_close(f); \
ap_status_t status = ap_getc(&c, f); \
if (status != APR_SUCCESS) { /* either EOF or error -- needs error handling if latter */ \
if (status != APR_EOF) { \
- fprintf(stderr, "encountered error in GET_CHAR macro, " \
- "mod_include.\n"); \
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, \
+ "encountered error in GET_CHAR macro, " \
+ "mod_include."); \
} \
ap_close(f); \
return r; \
}
#ifdef NEG_DEBUG
- fprintf(stderr, "dont_fiddle_headers=%d use_rvsa=%d ua_supports_trans=%d "
- "send_alternates=%d, may_choose=%d\n",
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "dont_fiddle_headers=%d use_rvsa=%d ua_supports_trans=%d "
+ "send_alternates=%d, may_choose=%d",
neg->dont_fiddle_headers, neg->use_rvsa,
neg->ua_supports_trans, neg->send_alternates, neg->may_choose);
#endif
*/
#ifdef NEG_DEBUG
- fprintf(stderr, "Variant: file=%s type=%s lang=%s sourceq=%1.3f "
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Variant: file=%s type=%s lang=%s sourceq=%1.3f "
"mimeq=%1.3f langq=%1.3f charq=%1.3f encq=%1.3f "
- "q=%1.5f definite=%d\n",
+ "q=%1.5f definite=%d",
(variant->file_name ? variant->file_name : ""),
(variant->mime_type ? variant->mime_type : ""),
(variant->content_languages
*/
#ifdef NEG_DEBUG
- fprintf(stderr, "Variant: file=%s type=%s lang=%s sourceq=%1.3f "
- "mimeq=%1.3f langq=%1.3f langidx=%d charq=%1.3f encq=%1.3f \n",
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Variant: file=%s type=%s lang=%s sourceq=%1.3f "
+ "mimeq=%1.3f langq=%1.3f langidx=%d charq=%1.3f encq=%1.3f ",
(variant->file_name ? variant->file_name : ""),
(variant->mime_type ? variant->mime_type : ""),
(variant->content_languages
static const char *load_file(cmd_parms *cmd, void *dummy, char *filename)
{
- fprintf(stderr, "WARNING: LoadFile not supported on this platform\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: LoadFile not supported on this platform");
return NULL;
}
static const char *load_module(cmd_parms *cmd, void *dummy,
char *modname, char *filename)
{
- fprintf(stderr, "WARNING: LoadModule not supported on this platform\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: LoadModule not supported on this platform");
return NULL;
}
if (ap_proxy_is_ipaddr(New, parms->pool)) {
#if DEBUGGING
- fprintf(stderr, "Parsed addr %s\n", inet_ntoa(New->addr));
- fprintf(stderr, "Parsed mask %s\n", inet_ntoa(New->mask));
+ 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, 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
- fprintf(stderr, "Parsed domain %s\n", New->name);
+ 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
- fprintf(stderr, "Parsed host %s\n", New->name);
+ 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
- fprintf(stderr, "Parsed word %s\n", New->name);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Parsed word %s", New->name);
#endif
}
}
bits = 8 * quads;
if (bits != 32) /* no warning for fully qualified IP address */
- fprintf(stderr, "Warning: NetMask not supplied with IP-Addr; guessing: %s/%ld\n",
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Warning: NetMask not supplied with IP-Addr; guessing: %s/%ld",
inet_ntoa(This->addr), bits);
}
This->mask.s_addr = htonl(INADDR_NONE << (32 - bits));
if (*addr == '\0' && (This->addr.s_addr & ~This->mask.s_addr) != 0) {
- fprintf(stderr, "Warning: NetMask and IP-Addr disagree in %s/%ld\n",
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Warning: NetMask and IP-Addr disagree in %s/%ld\n",
inet_ntoa(This->addr), bits);
This->addr.s_addr &= This->mask.s_addr;
- fprintf(stderr, " Set to %s/%ld\n",
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ " Set to %s/%ld",
inet_ntoa(This->addr), bits);
}
if (This->addr.s_addr == (addr.s_addr & This->mask.s_addr)) {
#if DEBUGGING
- fprintf(stderr, "1)IP-Match: %s[%s] <-> ", host, inet_ntoa(addr));
- fprintf(stderr, "%s/", inet_ntoa(This->addr));
- fprintf(stderr, "%s\n", inet_ntoa(This->mask));
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "1)IP-Match: %s[%s] <-> ", host, inet_ntoa(addr));
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s/", inet_ntoa(This->addr));
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s", inet_ntoa(This->mask));
#endif
return 1;
}
#if DEBUGGING
else {
- fprintf(stderr, "1)IP-NoMatch: %s[%s] <-> ", host, inet_ntoa(addr));
- fprintf(stderr, "%s/", inet_ntoa(This->addr));
- fprintf(stderr, "%s\n", inet_ntoa(This->mask));
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "1)IP-NoMatch: %s[%s] <-> ", host, inet_ntoa(addr));
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s/", inet_ntoa(This->addr));
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s", inet_ntoa(This->mask));
}
#endif
}
if (found != NULL) {
#if DEBUGGING
- fprintf(stderr, "2)IP-NoMatch: hostname=%s msg=%s\n", host, found);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "2)IP-NoMatch: hostname=%s msg=%s", host, found);
#endif
return 0;
}
ip_list = (struct in_addr *) *ip_listptr;
if (This->addr.s_addr == (ip_list->s_addr & This->mask.s_addr)) {
#if DEBUGGING
- fprintf(stderr, "3)IP-Match: %s[%s] <-> ", found, inet_ntoa(*ip_list));
- fprintf(stderr, "%s/", inet_ntoa(This->addr));
- fprintf(stderr, "%s\n", inet_ntoa(This->mask));
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "3)IP-Match: %s[%s] <-> ", found, inet_ntoa(*ip_list));
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s/", inet_ntoa(This->addr));
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s", inet_ntoa(This->mask));
#endif
return 1;
}
#if DEBUGGING
else {
- fprintf(stderr, "3)IP-NoMatch: %s[%s] <-> ", found, inet_ntoa(*ip_list));
- fprintf(stderr, "%s/", inet_ntoa(This->addr));
- fprintf(stderr, "%s\n", inet_ntoa(This->mask));
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "3)IP-NoMatch: %s[%s] <-> ", found, inet_ntoa(*ip_list));
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s/", inet_ntoa(This->addr));
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s", inet_ntoa(This->mask));
}
#endif
}
#if 0
if (addr[i] == ':') {
- fprintf(stderr, "@@@@ handle optional port in proxy_is_domainname()\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "@@@@ handle optional port in proxy_is_domainname()");
/* @@@@ handle optional port */
}
#endif
#if 0
if (addr[i] == ':') {
- fprintf(stderr, "@@@@ handle optional port in proxy_is_hostname()\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "@@@@ handle optional port in proxy_is_hostname()");
/* @@@@ handle optional port */
}
#endif
exit(0);
else if (x == -1) {
perror("fork");
- fprintf(stderr, "%s: unable to fork new process\n", ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: unable to fork new process", ap_server_argv0);
exit(1);
}
*/
if ((pgrp = setsid()) == -1) {
perror("setsid");
- fprintf(stderr, "%s: setsid failed\n", ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: setsid failed", ap_server_argv0);
exit(1);
}
/* close out the standard file descriptors */
if (freopen("/dev/null", "r", stdin) == NULL) {
- fprintf(stderr, "%s: unable to replace stdin with /dev/null: %s\n",
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: unable to replace stdin with /dev/null: %s",
ap_server_argv0, strerror(errno));
/* continue anyhow -- note we can't close out descriptor 0 because we
* have nothing to replace it with, and if we didn't have a descriptor
*/
}
if (freopen("/dev/null", "w", stdout) == NULL) {
- fprintf(stderr, "%s: unable to replace stdout with /dev/null: %s\n",
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: unable to replace stdout with /dev/null: %s",
ap_server_argv0, strerror(errno));
}
/* stderr is a tricky one, we really want it to be the error_log,
exit(0);
else if (x == -1) {
perror("fork");
- fprintf(stderr, "%s: unable to fork new process\n", ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: unable to fork new process", ap_server_argv0);
exit(1);
}
RAISE_SIGSTOP(DETACH);
#ifndef NO_SETSID
if ((pgrp = setsid()) == -1) {
perror("setsid");
- fprintf(stderr, "%s: setsid failed\n", ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: setsid failed", ap_server_argv0);
exit(1);
}
#elif defined(NEXT) || defined(NEWSOS)
if (setpgrp(0, getpid()) == -1 || (pgrp = getpgrp(0)) == -1) {
perror("setpgrp");
- fprintf(stderr, "%s: setpgrp or getpgrp failed\n", ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: setpgrp or getpgrp failed", ap_server_argv0);
exit(1);
}
#elif defined(OS2) || defined(TPF)
#else
if ((pgrp = setpgrp(getpid(), 0)) == -1) {
perror("setpgrp");
- fprintf(stderr, "%s: setpgrp failed\n", ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: setpgrp failed", ap_server_argv0);
exit(1);
}
#endif
/* close out the standard file descriptors */
if (freopen("/dev/null", "r", stdin) == NULL) {
- fprintf(stderr, "%s: unable to replace stdin with /dev/null: %s\n",
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: unable to replace stdin with /dev/null: %s",
ap_server_argv0, strerror(errno));
/* continue anyhow -- note we can't close out descriptor 0 because we
* have nothing to replace it with, and if we didn't have a descriptor
*/
}
if (freopen("/dev/null", "w", stdout) == NULL) {
- fprintf(stderr, "%s: unable to replace stdout with /dev/null: %s\n",
- ap_server_argv0, strerror(errno));
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: unable to replace stdout with /dev/null: %s",
+ ap_server_argv0, strerror(errno));
}
/* stderr is a tricky one, we really want it to be the error_log,
* but we haven't opened that yet. So leave it alone for now and it'll
min_spare_threads = atoi(arg);
if (min_spare_threads <= 0) {
- fprintf(stderr, "WARNING: detected MinSpareThreads set to non-positive.\n");
- fprintf(stderr, "Resetting to 1 to avoid almost certain Apache failure.\n");
- fprintf(stderr, "Please read the documentation.\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: detected MinSpareThreads set to non-positive.");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Resetting to 1 to avoid almost certain Apache failure.");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Please read the documentation.");
min_spare_threads = 1;
}
ap_daemons_limit = atoi(arg);
if (ap_daemons_limit > HARD_SERVER_LIMIT) {
- fprintf(stderr, "WARNING: MaxClients of %d exceeds compile time limit "
- "of %d servers,\n", ap_daemons_limit, HARD_SERVER_LIMIT);
- fprintf(stderr, " lowering MaxClients to %d. To increase, please "
- "see the\n", HARD_SERVER_LIMIT);
- fprintf(stderr, " HARD_SERVER_LIMIT define in src/include/httpd.h.\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: MaxClients of %d exceeds compile time limit "
+ "of %d servers,", ap_daemons_limit, HARD_SERVER_LIMIT);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ " lowering MaxClients to %d. To increase, please "
+ "see the", HARD_SERVER_LIMIT);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ " HARD_SERVER_LIMIT define in src/include/httpd.h.");
ap_daemons_limit = HARD_SERVER_LIMIT;
}
else if (ap_daemons_limit < 1) {
- fprintf(stderr, "WARNING: Require MaxClients > 0, setting to 1\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: Require MaxClients > 0, setting to 1");
ap_daemons_limit = 1;
}
return NULL;
ap_threads_per_child = atoi(arg);
if (ap_threads_per_child > HARD_THREAD_LIMIT) {
- fprintf(stderr, "WARNING: ThreadsPerChild of %d exceeds compile time"
- "limit of %d threads,\n", ap_threads_per_child,
- HARD_THREAD_LIMIT);
- fprintf(stderr, " lowering ThreadsPerChild to %d. To increase, please"
- "see the\n", HARD_THREAD_LIMIT);
- fprintf(stderr, " HARD_THREAD_LIMIT define in src/include/httpd.h.\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: ThreadsPerChild of %d exceeds compile time"
+ "limit of %d threads,\n", ap_threads_per_child,
+ HARD_THREAD_LIMIT);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ " lowering ThreadsPerChild to %d. To increase, please"
+ "see the", HARD_THREAD_LIMIT);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ " HARD_THREAD_LIMIT define in src/include/httpd.h.");
}
else if (ap_threads_per_child < 1) {
- fprintf(stderr, "WARNING: Require ThreadsPerChild > 0, setting to 1\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: Require ThreadsPerChild > 0, setting to 1");
ap_threads_per_child = 1;
}
return NULL;
ap_assert(!ap_scoreboard_image);
ap_scoreboard_image = (scoreboard *) malloc(SCOREBOARD_SIZE);
if (ap_scoreboard_image == NULL) {
- fprintf(stderr, "Ouch! Out of memory reiniting scoreboard!\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Ouch! Out of memory reiniting scoreboard!");
}
memset(ap_scoreboard_image, 0, SCOREBOARD_SIZE);
}
min_spare_threads = atoi(arg);
if (min_spare_threads <= 0) {
- fprintf(stderr, "WARNING: detected MinSpareThreads set to non-positive.\n");
- fprintf(stderr, "Resetting to 1 to avoid almost certain Apache failure.\n");
- fprintf(stderr, "Please read the documentation.\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: detected MinSpareThreads set to non-positive.");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Resetting to 1 to avoid almost certain Apache failure.");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Please read the documentation.");
min_spare_threads = 1;
}
ap_daemons_limit = atoi(arg);
if (ap_daemons_limit > HARD_SERVER_LIMIT) {
- fprintf(stderr, "WARNING: MaxClients of %d exceeds compile time limit "
- "of %d servers,\n", ap_daemons_limit, HARD_SERVER_LIMIT);
- fprintf(stderr, " lowering MaxClients to %d. To increase, please "
- "see the\n", HARD_SERVER_LIMIT);
- fprintf(stderr, " HARD_SERVER_LIMIT define in src/include/httpd.h.\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: MaxClients of %d exceeds compile time limit "
+ "of %d servers,", ap_daemons_limit, HARD_SERVER_LIMIT);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ " lowering MaxClients to %d. To increase, please "
+ "see the", HARD_SERVER_LIMIT);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ " HARD_SERVER_LIMIT define in src/include/httpd.h.");
ap_daemons_limit = HARD_SERVER_LIMIT;
}
else if (ap_daemons_limit < 1) {
- fprintf(stderr, "WARNING: Require MaxClients > 0, setting to 1\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "WARNING: Require MaxClients > 0, setting to 1\n");
ap_daemons_limit = 1;
}
return NULL;
ap_threads_per_child = atoi(arg);
if (ap_threads_per_child > HARD_THREAD_LIMIT) {
- fprintf(stderr, "WARNING: ThreadsPerChild of %d exceeds compile time"
- "limit of %d threads,\n", ap_threads_per_child,
- HARD_THREAD_LIMIT);
- fprintf(stderr, " lowering ThreadsPerChild to %d. To increase, please"
- "see the\n", HARD_THREAD_LIMIT);
- fprintf(stderr, " HARD_THREAD_LIMIT define in src/include/httpd.h.\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: ThreadsPerChild of %d exceeds compile time"
+ "limit of %d threads,", ap_threads_per_child,
+ HARD_THREAD_LIMIT);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ " lowering ThreadsPerChild to %d. To increase, please"
+ "see the", HARD_THREAD_LIMIT);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ " HARD_THREAD_LIMIT define in src/include/httpd.h.");
}
else if (ap_threads_per_child < 1) {
- fprintf(stderr, "WARNING: Require ThreadsPerChild > 0, setting to 1\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: Require ThreadsPerChild > 0, setting to 1");
ap_threads_per_child = 1;
}
return NULL;
ap_assert(!ap_scoreboard_image);
ap_scoreboard_image = (scoreboard *) malloc(SCOREBOARD_SIZE);
if (ap_scoreboard_image == NULL) {
- fprintf(stderr, "Ouch! Out of memory reiniting scoreboard!\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Ouch! Out of memory reiniting scoreboard!");
}
memset(ap_scoreboard_image, 0, SCOREBOARD_SIZE);
}
m = (caddr_t) create_shared_heap("\\SHAREMEM\\SCOREBOARD", SCOREBOARD_SIZE);
if (m == 0) {
- fprintf(stderr, "%s: Could not create OS/2 Shared memory pool.\n",
- ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not create OS/2 Shared memory pool.",
+ ap_server_argv0);
exit(APEXIT_INIT);
}
rc = _uopen((Heap_t) m);
if (rc != 0) {
- fprintf(stderr,
- "%s: Could not uopen() newly created OS/2 Shared memory pool.\n",
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not uopen() newly created OS/2 Shared memory pool.",
ap_server_argv0);
}
ap_scoreboard_image = (scoreboard *) m;
m = (caddr_t) get_shared_heap("\\SHAREMEM\\SCOREBOARD");
if (m == 0) {
- fprintf(stderr, "%s: Could not find existing OS/2 Shared memory pool.\n",
- ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not find existing OS/2 Shared memory pool.",
+ ap_server_argv0);
exit(APEXIT_INIT);
}
int fd = mkstemp(mfile);
if (fd == -1) {
perror("open");
- fprintf(stderr, "%s: Could not open %s\n", ap_server_argv0, mfile);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not open %s", ap_server_argv0, mfile);
exit(APEXIT_INIT);
}
m = mmap((caddr_t) 0, SCOREBOARD_SIZE,
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (m == (caddr_t) - 1) {
perror("mmap");
- fprintf(stderr, "%s: Could not mmap %s\n", ap_server_argv0, mfile);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not mmap %s", ap_server_argv0, mfile);
exit(APEXIT_INIT);
}
close(fd);
#endif
if (m == (caddr_t) - 1) {
perror("mmap");
- fprintf(stderr, "%s: Could not mmap memory\n", ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not mmap memory", ap_server_argv0);
exit(APEXIT_INIT);
}
#else
fd = open("/dev/zero", O_RDWR);
if (fd == -1) {
perror("open");
- fprintf(stderr, "%s: Could not open /dev/zero\n", ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not open /dev/zero", ap_server_argv0);
exit(APEXIT_INIT);
}
m = mmap((caddr_t) 0, SCOREBOARD_SIZE,
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (m == (caddr_t) - 1) {
perror("mmap");
- fprintf(stderr, "%s: Could not mmap /dev/zero\n", ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not mmap /dev/zero", ap_server_argv0);
exit(APEXIT_INIT);
}
close(fd);
ap_get_os_file(&scoreboard_fd, scoreboard_file);
if (scoreboard_fd == -1) {
perror(ap_scoreboard_fname);
- fprintf(stderr, "Cannot open scoreboard file:\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Cannot open scoreboard file:");
clean_child_exit(1);
}
}
ap_get_os_file(&scoreboard_fd, scoreboard_file);
if (scoreboard_fd == -1) {
perror(ap_scoreboard_fname);
- fprintf(stderr, "Cannot open scoreboard file:\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Cannot open scoreboard file:");
exit(APEXIT_INIT);
}
ap_register_cleanup(p, NULL, cleanup_scoreboard_file, ap_null_cleanup);
/* got lock */
break;
case 0:
- fprintf(stderr, "didn't get lock\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "didn't get lock");
clean_child_exit(APEXIT_CHILDFATAL);
case -1:
perror("ussetlock");
ap_get_os_file(&lock_fd, tempfile);
if (lock_fd == -1) {
perror("open");
- fprintf(stderr, "Cannot open lock file: %s\n", ap_lock_fname);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Cannot open lock file: %s", ap_lock_fname);
exit(APEXIT_INIT);
}
unlink(ap_lock_fname);
m = (caddr_t) create_shared_heap("\\SHAREMEM\\SCOREBOARD", SCOREBOARD_SIZE);
if (m == 0) {
- fprintf(stderr, "%s: Could not create OS/2 Shared memory pool.\n",
- ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not create OS/2 Shared memory pool.",
+ ap_server_argv0);
exit(APEXIT_INIT);
}
rc = _uopen((Heap_t) m);
if (rc != 0) {
- fprintf(stderr,
- "%s: Could not uopen() newly created OS/2 Shared memory pool.\n",
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not uopen() newly created OS/2 Shared memory pool.",
ap_server_argv0);
}
ap_scoreboard_image = (scoreboard *) m;
m = (caddr_t) get_shared_heap("\\SHAREMEM\\SCOREBOARD");
if (m == 0) {
- fprintf(stderr, "%s: Could not find existing OS/2 Shared memory pool.\n",
- ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not find existing OS/2 Shared memory pool.",
+ ap_server_argv0);
exit(APEXIT_INIT);
}
int fd = mkstemp(mfile);
if (fd == -1) {
perror("open");
- fprintf(stderr, "%s: Could not open %s\n", ap_server_argv0, mfile);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not open %s", ap_server_argv0, mfile);
exit(APEXIT_INIT);
}
m = mmap((caddr_t) 0, SCOREBOARD_SIZE,
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (m == (caddr_t) - 1) {
perror("mmap");
- fprintf(stderr, "%s: Could not mmap %s\n", ap_server_argv0, mfile);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not mmap %s", ap_server_argv0, mfile);
exit(APEXIT_INIT);
}
close(fd);
#endif
if (m == (caddr_t) - 1) {
perror("mmap");
- fprintf(stderr, "%s: Could not mmap memory\n", ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not mmap memory", ap_server_argv0);
exit(APEXIT_INIT);
}
#else
fd = open("/dev/zero", O_RDWR);
if (fd == -1) {
perror("open");
- fprintf(stderr, "%s: Could not open /dev/zero\n", ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not open /dev/zero", ap_server_argv0);
exit(APEXIT_INIT);
}
m = mmap((caddr_t) 0, SCOREBOARD_SIZE,
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (m == (caddr_t) - 1) {
perror("mmap");
- fprintf(stderr, "%s: Could not mmap /dev/zero\n", ap_server_argv0);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "%s: Could not mmap /dev/zero", ap_server_argv0);
exit(APEXIT_INIT);
}
close(fd);
ap_scoreboard_image = (scoreboard *) gsysc(SCOREBOARD_FRAMES, SCOREBOARD_NAME);
if (!ap_scoreboard_image) {
- fprintf(stderr, "httpd: Could not create scoreboard system heap storage.\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "httpd: Could not create scoreboard system heap storage.");
exit(APEXIT_INIT);
}
scoreboard_fd = ap_popenf(p, ap_scoreboard_fname, O_CREAT | O_BINARY | O_RDWR, 0666);
if (scoreboard_fd == -1) {
perror(ap_scoreboard_fname);
- fprintf(stderr, "Cannot open scoreboard file:\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Cannot open scoreboard file:");
clean_child_exit(1);
}
}
scoreboard_fd = ap_popenf(p, ap_scoreboard_fname, O_CREAT | O_BINARY | O_RDWR, 0644);
if (scoreboard_fd == -1) {
perror(ap_scoreboard_fname);
- fprintf(stderr, "Cannot open scoreboard file:\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Cannot open scoreboard file:");
exit(APEXIT_INIT);
}
ap_register_cleanup(p, NULL, cleanup_scoreboard_file, ap_null_cleanup);
ap_daemons_min_free = atoi(arg);
if (ap_daemons_min_free <= 0) {
- fprintf(stderr, "WARNING: detected MinSpareServers set to non-positive.\n");
- fprintf(stderr, "Resetting to 1 to avoid almost certain Apache failure.\n");
- fprintf(stderr, "Please read the documentation.\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: detected MinSpareServers set to non-positive.");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Resetting to 1 to avoid almost certain Apache failure.");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Please read the documentation.");
ap_daemons_min_free = 1;
}
ap_daemons_limit = atoi(arg);
if (ap_daemons_limit > HARD_SERVER_LIMIT) {
- fprintf(stderr, "WARNING: MaxClients of %d exceeds compile time limit "
- "of %d servers,\n", ap_daemons_limit, HARD_SERVER_LIMIT);
- fprintf(stderr, " lowering MaxClients to %d. To increase, please "
- "see the\n", HARD_SERVER_LIMIT);
- fprintf(stderr, " HARD_SERVER_LIMIT define in src/include/httpd.h.\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: MaxClients of %d exceeds compile time limit "
+ "of %d servers,", ap_daemons_limit, HARD_SERVER_LIMIT);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ " lowering MaxClients to %d. To increase, please "
+ "see the", HARD_SERVER_LIMIT);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ " HARD_SERVER_LIMIT define in src/include/httpd.h.");
ap_daemons_limit = HARD_SERVER_LIMIT;
}
else if (ap_daemons_limit < 1) {
- fprintf(stderr, "WARNING: Require MaxClients > 0, setting to 1\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: Require MaxClients > 0, setting to 1");
ap_daemons_limit = 1;
}
return NULL;
ap_scoreboard_image = (scoreboard *) malloc(SCOREBOARD_SIZE);
if (ap_scoreboard_image == NULL) {
- fprintf(stderr, "Ouch! Out of memory reiniting scoreboard!\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Ouch! Out of memory reiniting scoreboard!");
}
}
ap_daemons_min_free = atoi(arg);
if (ap_daemons_min_free <= 0) {
- fprintf(stderr, "WARNING: detected MinSpareServers set to non-positive.\n");
- fprintf(stderr, "Resetting to 1 to avoid almost certain Apache failure.\n");
- fprintf(stderr, "Please read the documentation.\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: detected MinSpareServers set to non-positive.");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Resetting to 1 to avoid almost certain Apache failure.");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Please read the documentation.");
ap_daemons_min_free = 1;
}
ap_daemons_limit = atoi(arg);
if (ap_daemons_limit > HARD_SERVER_LIMIT) {
- fprintf(stderr, "WARNING: MaxClients of %d exceeds compile time limit "
- "of %d servers,\n", ap_daemons_limit, HARD_SERVER_LIMIT);
- fprintf(stderr, " lowering MaxClients to %d. To increase, please "
- "see the\n", HARD_SERVER_LIMIT);
- fprintf(stderr, " HARD_SERVER_LIMIT define in src/include/httpd.h.\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: MaxClients of %d exceeds compile time limit "
+ "of %d servers,", ap_daemons_limit, HARD_SERVER_LIMIT);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ " lowering MaxClients to %d. To increase, please "
+ "see the", HARD_SERVER_LIMIT);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ " HARD_SERVER_LIMIT define in src/include/httpd.h.");
ap_daemons_limit = HARD_SERVER_LIMIT;
}
else if (ap_daemons_limit < 1) {
- fprintf(stderr, "WARNING: Require MaxClients > 0, setting to 1\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: Require MaxClients > 0, setting to 1");
ap_daemons_limit = 1;
}
return NULL;
new_job = (joblist *) malloc(sizeof(joblist));
if (new_job == NULL) {
- fprintf(stderr, "Ouch! Out of memory in add_job()!\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "Ouch! Out of memory in add_job()!");
return;
}
new_job->next = NULL;
ap_threads_per_child = atoi(arg);
if (ap_threads_per_child > HARD_THREAD_LIMIT) {
- fprintf(stderr, "WARNING: ThreadsPerChild of %d exceeds compile time"
- " limit of %d threads,\n", ap_threads_per_child,
- HARD_THREAD_LIMIT);
- fprintf(stderr, " lowering ThreadsPerChild to %d. To increase, please"
- " see the\n", HARD_THREAD_LIMIT);
- fprintf(stderr, " HARD_THREAD_LIMIT define in src/include/httpd.h.\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: ThreadsPerChild of %d exceeds compile time"
+ " limit of %d threads,", ap_threads_per_child,
+ HARD_THREAD_LIMIT);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " lowering ThreadsPerChild to %d. To increase, please"
+ " see the", HARD_THREAD_LIMIT);
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ " HARD_THREAD_LIMIT define in src/include/httpd.h.");
}
else if (ap_threads_per_child < 1) {
- fprintf(stderr, "WARNING: Require ThreadsPerChild > 0, setting to 1\n");
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ "WARNING: Require ThreadsPerChild > 0, setting to 1");
ap_threads_per_child = 1;
}
return NULL;