]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
TPF-specific changes for syslog and option passing (such as -f).
authorDavid McCreedy <mccreedy@apache.org>
Sun, 19 May 2002 04:55:39 +0000 (04:55 +0000)
committerDavid McCreedy <mccreedy@apache.org>
Sun, 19 May 2002 04:55:39 +0000 (04:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@95174 13f79535-47bb-0310-9956-ffa450edef68

src/main/http_log.c
src/main/http_main.c
src/os/tpf/os.c
src/os/tpf/os.h

index c3fd24a4c79ac62cfe374a141688f8a3f178a452..174cc5466b0a0f5ffe0423a77c6ee38018bfbc49 100644 (file)
@@ -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
index b956a214852fa5cabb3a288ff783c36ee9e284b0..91ab9265931b3c1c530ef14e8d040c20b6b374f8 100644 (file)
@@ -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;
index dadd9534d58b9bef6706fb7c4ba5093bf1ad6c95..370c2a2c3b23d5d6cbf5c7e9033502e1f7d9661c 100644 (file)
@@ -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
 
 }
index cf0b087186f02a210d9f2298399907ee0e60e203..37f42d40a0dcb95c9f1f4fc1e2092d037a0e102f 100644 (file)
 #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: */