This is a resubmission of my original patch with Jeff Trawick's
suggestions now incorporated...

This patch is specific to TPF code and therefore shouldn't affect other
platforms.

It does the following:

1) Allow the use of Apache's -f, -d, -D, & -X flags on IBM's TPF
operating system
2) Allow syslog to be used by Apache on TPF
3) Remove unused expat-lite object files from the sample link JCL

Please let me know if you have any concerns or comments.

Thank you,

David McCreedy
[EMAIL PROTECTED]


Index: apache-1.3/src/main/http_log.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/http_log.c,v
retrieving revision 1.93
diff -u -d -b -r1.93 http_log.c
--- apache-1.3/src/main/http_log.c      13 Mar 2002 21:05:30 -0000      1.93
+++ apache-1.3/src/main/http_log.c      16 May 2002 04:39:38 -0000
@@ -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
Index: apache-1.3/src/main/http_main.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
retrieving revision 1.582
diff -u -d -b -r1.582 http_main.c
--- apache-1.3/src/main/http_main.c     13 May 2002 23:12:02 -0000      1.582
+++ apache-1.3/src/main/http_main.c     16 May 2002 04:39:39 -0000
@@ -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;
Index: apache-1.3/src/os/tpf/os.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/os/tpf/os.c,v
retrieving revision 1.16
diff -u -d -b -r1.16 os.c
--- apache-1.3/src/os/tpf/os.c  13 Mar 2002 21:05:36 -0000      1.16
+++ apache-1.3/src/os/tpf/os.c  16 May 2002 04:39:39 -0000
@@ -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
 
 }
Index: apache-1.3/src/os/tpf/os.h
===================================================================
RCS file: /home/cvs/apache-1.3/src/os/tpf/os.h,v
retrieving revision 1.14
diff -u -d -b -r1.14 os.h
--- apache-1.3/src/os/tpf/os.h  22 Jun 2001 12:43:55 -0000      1.14
+++ apache-1.3/src/os/tpf/os.h  16 May 2002 04:39:39 -0000
@@ -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: */
 
Index: apache-1.3/src/os/tpf/samples/linkhttp.jcl
===================================================================
RCS file: /home/cvs/apache-1.3/src/os/tpf/samples/linkhttp.jcl,v
retrieving revision 1.1
diff -u -d -b -r1.1 linkhttp.jcl
--- apache-1.3/src/os/tpf/samples/linkhttp.jcl  9 Mar 2001 10:17:48 -0000       1.1
+++ apache-1.3/src/os/tpf/samples/linkhttp.jcl  16 May 2002 04:39:39 -0000
@@ -82,12 +82,6 @@
 //PLKED.OBJ51  DD PATH='/<your-path-here>/src/regex/regerror.o'
 //PLKED.OBJ52  DD PATH='/<your-path-here>/src/regex/regexec.o'
 //PLKED.OBJ53  DD PATH='/<your-path-here>/src/regex/regfree.o'
-//PLKED.OBJ54  DD PATH='/<your-path-here>/src/lib/expat-lite/hashtable.\
-//             o'
-//PLKED.OBJ55  DD PATH='/<your-path-here>/src/lib/expat-lite/xmlparse.o\
-//             '
-//PLKED.OBJ56  DD PATH='/<your-path-here>/src/lib/expat-lite/xmlrole.o'
-//PLKED.OBJ57  DD PATH='/<your-path-here>/src/lib/expat-lite/xmltok.o'
 //PLKED.SYSIN DD *
  ORDER @@DLMHDR
  INCLUDE OBJLIB(CSTRTD40)
@@ -144,10 +138,6 @@
  INCLUDE OBJ51
  INCLUDE OBJ52
  INCLUDE OBJ53
- INCLUDE OBJ54
- INCLUDE OBJ55
- INCLUDE OBJ56
- INCLUDE OBJ57
  INCLUDE OBJLIB(CINET640)
 /*
 //*** WARNING *** NEVER change .LK to .OB in SYSLMOD!!!

Reply via email to