dgaudet 98/06/04 13:13:22
Modified: src CHANGES Configure src/ap ap_snprintf.c src/helpers GuessOS src/include conf.h http_main.h src/main http_log.c http_main.c src/modules/standard mod_status.c Log: Fix compilation on NEXTSTEP. PR: 2293, 2316 Submitted by: Rex Dieter <[EMAIL PROTECTED]> Revision Changes Path 1.885 +3 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.884 retrieving revision 1.885 diff -u -r1.884 -r1.885 --- CHANGES 1998/06/04 19:58:54 1.884 +++ CHANGES 1998/06/04 20:13:11 1.885 @@ -1,5 +1,8 @@ Changes with Apache 1.3.1 + *) PORT: Fix compilation failures on NEXTSTEP. + [Rex Dieter <[EMAIL PROTECTED]>] PR#2293, 2316 + *) PORT: F_NDELAY is a typo, should have been FNDELAY. There's also O_NDELAY on various systems. [Dave Dykstra <[EMAIL PROTECTED]>] PR#2313 1.262 +11 -2 apache-1.3/src/Configure Index: Configure =================================================================== RCS file: /export/home/cvs/apache-1.3/src/Configure,v retrieving revision 1.261 retrieving revision 1.262 diff -u -r1.261 -r1.262 --- Configure 1998/05/12 12:13:50 1.261 +++ Configure 1998/06/04 20:13:12 1.262 @@ -484,10 +484,19 @@ ;; *-next-nextstep*) OS='NeXT' + OPTIM='-O' CFLAGS="$CFLAGS -DNEXT" DEF_WANTHSREGEX=yes - RANLIB="sleep 5; /bin/ranlib" - # ranlib on most NeXTs sets the time wrong. 5 secs wait does much good + ;; + *-next-openstep*) + OS='Openstep for Mach' + CC='cc' + OPTIM='-O' + CFLAGS="$CFLAGS -DNEXT" + CFLAGS_SHLIB='-dynamic -fno-common' + LD_SHLIB='cc' + LDFLAGS_SHLIB='-dynamiclib -undefined warning' + DEF_WANTHSREGEX=yes ;; *-dec-osf*) OS='DEC OSF/1' 1.25 +4 -0 apache-1.3/src/ap/ap_snprintf.c Index: ap_snprintf.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/ap/ap_snprintf.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- ap_snprintf.c 1998/05/11 17:49:21 1.24 +++ ap_snprintf.c 1998/06/04 20:13:15 1.25 @@ -72,8 +72,12 @@ NO = 0, YES = 1 } boolean_e; +#ifndef FALSE #define FALSE 0 +#endif +#ifndef TRUE #define TRUE 1 +#endif #define NUL '\0' #define INT_NULL ((int *)0) #define WIDE_INT long 1.36 +15 -1 apache-1.3/src/helpers/GuessOS Index: GuessOS =================================================================== RCS file: /export/home/cvs/apache-1.3/src/helpers/GuessOS,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- GuessOS 1998/06/04 19:49:27 1.35 +++ GuessOS 1998/06/04 20:13:16 1.36 @@ -252,7 +252,21 @@ ISNEXT=`hostinfo 2>/dev/null` case "$ISNEXT" in *NeXT*) - echo "whatever-next-nextstep"; exit 0 +# echo "whatever-next-nextstep"; exit 0 + +# Swiped from a friendly uname clone for NEXT/OPEN Step. + NEXTOSVER="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`" + if [ "$NEXTOSVER" -gt 3.3 ] + then + NEXTOS="openstep" + else + NEXTOS="nextstep" + fi + + NEXTREL="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`" + NEXTARCH=`arch` + echo "${NEXTARCH}-next-${NEXTOS}${NEXTREL}" ; exit 0 + ;; esac 1.214 +10 -0 apache-1.3/src/include/conf.h Index: conf.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/conf.h,v retrieving revision 1.213 retrieving revision 1.214 diff -u -r1.213 -r1.214 --- conf.h 1998/06/03 17:54:45 1.213 +++ conf.h 1998/06/04 20:13:17 1.214 @@ -356,7 +356,13 @@ #define STDIN_FILENO 0 #define STDOUT_FILENO 1 #define STDERR_FILENO 2 + +/* PR#2293 fix */ +#define ap_wait_t union wait #define waitpid(a,b,c) wait4((a) == -1 ? 0 : (a),(union wait *)(b),c,NULL) +#define WEXITSTATUS(status) (int)( WIFEXITED(status) ? ( (status).w_retcode ) : -1) +#define WTERMSIG(status) (int)( (status).w_termsig ) + typedef int pid_t; #define USE_LONGJMP #define NO_USE_SIGACTION @@ -1181,6 +1187,10 @@ #endif #ifdef NEED_DIFFTIME extern double difftime(time_t time1, time_t time0); +#endif + +#ifndef ap_wait_t +#define ap_wait_t int #endif #ifdef __cplusplus 1.30 +1 -1 apache-1.3/src/include/http_main.h Index: http_main.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/http_main.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- http_main.h 1998/05/03 17:31:09 1.29 +++ http_main.h 1998/06/04 20:13:17 1.30 @@ -143,7 +143,7 @@ * disable this feature, use -1 for write_fd. */ API_EXPORT(void) ap_register_other_child(int pid, - void (*maintenance) (int reason, void *data, int status), void *data, + void (*maintenance) (int reason, void *data, ap_wait_t status), void *data, int write_fd); #define OC_REASON_DEATH 0 /* child has died, caller must call * unregister still */ 1.61 +2 -2 apache-1.3/src/main/http_log.c Index: http_log.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_log.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- http_log.c 1998/05/29 00:09:22 1.60 +++ http_log.c 1998/06/04 20:13:19 1.61 @@ -479,7 +479,7 @@ #ifndef NO_RELIABLE_PIPED_LOGS /* forward declaration */ -static void piped_log_maintenance (int reason, void *data, int status); +static void piped_log_maintenance (int reason, void *data, ap_wait_t status); static int piped_log_spawn (piped_log *pl) { @@ -519,7 +519,7 @@ } -static void piped_log_maintenance (int reason, void *data, int status) +static void piped_log_maintenance (int reason, void *data, ap_wait_t status) { piped_log *pl = data; 1.358 +6 -6 apache-1.3/src/main/http_main.c Index: http_main.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v retrieving revision 1.357 retrieving revision 1.358 diff -u -r1.357 -r1.358 --- http_main.c 1998/05/29 08:18:49 1.357 +++ http_main.c 1998/06/04 20:13:19 1.358 @@ -318,7 +318,7 @@ struct other_child_rec { other_child_rec *next; int pid; - void (*maintenance) (int, void *, int); + void (*maintenance) (int, void *, ap_wait_t); void *data; int write_fd; }; @@ -1298,7 +1298,7 @@ #ifndef NO_OTHER_CHILD API_EXPORT(void) ap_register_other_child(int pid, - void (*maintenance) (int reason, void *, int status), + void (*maintenance) (int reason, void *, ap_wait_t status), void *data, int write_fd) { other_child_rec *ocr; @@ -1384,7 +1384,7 @@ } /* possibly reap an other_child, return 0 if yes, -1 if not */ -static int reap_other_child(int pid, int status) +static int reap_other_child(int pid, ap_wait_t status) { other_child_rec *ocr, *nocr; @@ -2165,7 +2165,7 @@ #endif static int wait_or_timeout_counter; -static int wait_or_timeout(int *status) +static int wait_or_timeout(ap_wait_t *status) { #ifdef WIN32 #define MAXWAITOBJ MAXIMUM_WAIT_OBJECTS @@ -3914,7 +3914,7 @@ } -static void process_child_status(int pid, int status) +static void process_child_status(int pid, ap_wait_t status) { /* Child died... if it died due to a fatal error, * we should simply bail out. @@ -4063,7 +4063,7 @@ while (!restart_pending && !shutdown_pending) { int child_slot; - int status; + ap_wait_t status; int pid = wait_or_timeout(&status); /* XXX: if it takes longer than 1 second for all our children 1.88 +3 -3 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.87 retrieving revision 1.88 diff -u -r1.87 -r1.88 --- mod_status.c 1998/05/06 03:24:20 1.87 +++ mod_status.c 1998/06/04 20:13:21 1.88 @@ -119,8 +119,8 @@ #include "http_log.h" #ifdef NEXT -#if NX_CURRENT_COMPILER_RELEASE == 410 -#if __ARCHITECTURE__ == m68k +#if (NX_CURRENT_COMPILER_RELEASE == 410) +#ifdef m68k #define HZ 64 #else #define HZ 100 @@ -128,7 +128,7 @@ #else #include <machine/param.h> #endif -#endif +#endif /* NEXT */ #define STATUS_MAXLINE 64