From: David McCreedy Date: Sun, 19 May 2002 04:55:39 +0000 (+0000) Subject: TPF-specific changes for syslog and option passing (such as -f). X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c77e6538468f68007e659bbba4546c0e8a967987;p=thirdparty%2Fapache%2Fhttpd.git TPF-specific changes for syslog and option passing (such as -f). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@95174 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/main/http_log.c b/src/main/http_log.c index c3fd24a4c79..174cc5466b0 100644 --- a/src/main/http_log.c +++ b/src/main/http_log.c @@ -339,18 +339,6 @@ static void log_error_core(const char *file, int line, int level, return; logf = s->error_log; } -#ifdef TPF - else if (tpf_child) { - /* - * If we are doing normal logging, don't log messages that are - * above the server log level unless it is a startup/shutdown notice - */ - if (((level & APLOG_LEVELMASK) != APLOG_NOTICE) && - ((level & APLOG_LEVELMASK) > s->loglevel)) - return; - logf = stderr; - } -#endif /* TPF */ else { /* * If we are doing syslog logging, don't log messages that are diff --git a/src/main/http_main.c b/src/main/http_main.c index b956a214852..91ab9265931 100644 --- a/src/main/http_main.c +++ b/src/main/http_main.c @@ -5438,15 +5438,23 @@ int REALMAIN(int argc, char *argv[]) tpf_server_name[INETD_SERVNAME_LENGTH + 1] = '\0'; ap_open_logs(server_conf, plog); ap_tpf_zinet_checks(ap_standalone, tpf_server_name, server_conf); + ap_tpf_save_argv(argc, argv); /* save argv parms for children */ } if (ap_standalone) { ap_set_version(); ap_init_modules(pconf, server_conf); version_locked++; if(tpf_child) { + server_conf->error_log = stderr; +#ifdef HAVE_SYSLOG + /* if ErrorLog is syslog call ap_open_logs from the child since + syslog isn't redirected to stderr by the Apache parent */ + if (strncasecmp(server_conf->error_fname, "syslog", 6) == 0) { + ap_open_logs(server_conf, plog); + } +#endif /* HAVE_SYSLOG */ copy_listeners(pconf); reset_tpf_listeners(&input_parms.child); - server_conf->error_log = NULL; #ifdef SCOREBOARD_FILE scoreboard_fd = input_parms.child.scoreboard_fd; ap_scoreboard_image = &_scoreboard_image; diff --git a/src/os/tpf/os.c b/src/os/tpf/os.c index dadd9534d58..370c2a2c3b2 100644 --- a/src/os/tpf/os.c +++ b/src/os/tpf/os.c @@ -75,6 +75,7 @@ static TPF_FD_LIST *tpf_fds = NULL; void *tpf_shm_static_ptr = NULL; unsigned short zinet_model; +char *argv_ptr = NULL; static FILE *sock_fp; @@ -394,7 +395,7 @@ pid_t os_fork(server_rec *s, int slot) fork_input.prog_type = TPF_FORK_NAME; fork_input.istream = TPF_FORK_IS_BALANCE; fork_input.ebw_data_length = sizeof(input_parms); - fork_input.parm_data = "-x"; + fork_input.parm_data = argv_ptr; #ifdef TPF_FORK_EXTENDED return tpf_fork(&fork_input, NULL, NULL); #else @@ -479,6 +480,23 @@ void os_note_additional_cleanups(pool *p, int sd) { fcntl(sd,F_SETFD,FD_CLOEXEC); } +void ap_tpf_save_argv(int argc, char **argv) { + + int i, len = 3; /* 3 for "-x " */ + + for (i = 1; i < argc; i++) { /* find len for calloc */ + len += strlen (argv[i]); + ++len; /* 1 for blank */ + } + + argv_ptr = malloc(len + 1); + strcpy(argv_ptr, "-x"); + for (i = 1; i < argc; i++) { + strcat(argv_ptr, " "); + strcat(argv_ptr, argv[i]); + } +} + void os_tpf_child(APACHE_TPF_INPUT *input_parms) { tpf_child = 1; ap_my_generation = input_parms->generation; @@ -795,5 +813,9 @@ void show_os_specific_compile_settings(void) #ifdef TPF_HAVE_NSD printf(" -D TPF_HAVE_NSD\n"); #endif + +#ifdef HAVE_SYSLOG + printf(" -D HAVE_SYSLOG\n"); +#endif } diff --git a/src/os/tpf/os.h b/src/os/tpf/os.h index cf0b087186f..37f42d40a0d 100644 --- a/src/os/tpf/os.h +++ b/src/os/tpf/os.h @@ -76,6 +76,10 @@ #undef HAVE_ISNAN #endif +#ifdef HAVE_ISINF +#undef HAVE_ISINF +#endif + #if !defined(INLINE) && defined(USE_GNU_INLINE) /* Compiler supports inline, so include the inlineable functions as * part of the header @@ -193,6 +197,7 @@ extern int scoreboard_fd; #ifdef NSIG #undef NSIG #endif +void ap_tpf_save_argv(int argc, char **argv); /* various #defines for ServerType/ZINET model checks: */