You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mc...@apache.org on 2002/05/19 06:55:39 UTC
cvs commit: apache-1.3/src/os/tpf os.h os.c
mccreedy 02/05/18 21:55:39
Modified: src/main http_main.c http_log.c
src/os/tpf os.h os.c
Log:
TPF-specific changes for syslog and option passing (such as -f).
Revision Changes Path
1.583 +9 -1 apache-1.3/src/main/http_main.c
Index: http_main.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
retrieving revision 1.582
retrieving revision 1.583
diff -u -r1.582 -r1.583
--- http_main.c 13 May 2002 23:12:02 -0000 1.582
+++ http_main.c 19 May 2002 04:55:38 -0000 1.583
@@ -5438,15 +5438,23 @@
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;
1.94 +0 -12 apache-1.3/src/main/http_log.c
Index: http_log.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/http_log.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- http_log.c 13 Mar 2002 21:05:30 -0000 1.93
+++ http_log.c 19 May 2002 04:55:38 -0000 1.94
@@ -339,18 +339,6 @@
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
1.15 +5 -0 apache-1.3/src/os/tpf/os.h
Index: os.h
===================================================================
RCS file: /home/cvs/apache-1.3/src/os/tpf/os.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- os.h 22 Jun 2001 12:43:55 -0000 1.14
+++ os.h 19 May 2002 04:55:39 -0000 1.15
@@ -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 @@
#ifdef NSIG
#undef NSIG
#endif
+void ap_tpf_save_argv(int argc, char **argv);
/* various #defines for ServerType/ZINET model checks: */
1.17 +23 -1 apache-1.3/src/os/tpf/os.c
Index: os.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/os/tpf/os.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- os.c 13 Mar 2002 21:05:36 -0000 1.16
+++ os.c 19 May 2002 04:55:39 -0000 1.17
@@ -75,6 +75,7 @@
void *tpf_shm_static_ptr = NULL;
unsigned short zinet_model;
+char *argv_ptr = NULL;
static FILE *sock_fp;
@@ -394,7 +395,7 @@
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 @@
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;
@@ -794,6 +812,10 @@
#ifdef TPF_HAVE_NSD
printf(" -D TPF_HAVE_NSD\n");
+#endif
+
+#ifdef HAVE_SYSLOG
+ printf(" -D HAVE_SYSLOG\n");
#endif
}