httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <bri...@kheldar.apana.org.au>
Subject [PATCH] Change #ifdef __EMX__ to #ifdef OS2
Date Mon, 03 Aug 1998 05:01:33 GMT
This patch changes the #define used to indicate OS/2 to a more appropriate 
value. The value "__EMX__" currently used is actually the name of the gcc port 
used so it's like using "MSVC" instead of "WIN32".

I'd also like to rename the os/emx directory to os/os2 but I'm not sure what 
the best way to do that is.



Index: include/ap_config.h
===================================================================
RCS file: /cvs/apache-1.3/src/include/ap_config.h,v
retrieving revision 1.229
diff -u -r1.229 ap_config.h
--- ap_config.h	1998/07/21 15:03:06	1.229
+++ ap_config.h	1998/08/03 04:41:14
@@ -657,6 +657,7 @@
 
 #elif defined(__EMX__)
 /* Defines required for EMX OS/2 port. */
+#define OS2
 #define NO_KILLPG
 #define NEED_STRCASECMP
 #define NEED_STRNCASECMP
@@ -907,7 +908,7 @@
 #endif
 #endif
 #ifdef USE_MMAP_SCOREBOARD
-#if !defined(__EMX__) && !defined(WIN32)
+#if !defined(OS2) && !defined(WIN32)
 /* This file is not needed for OS/2 */
 #include <sys/mman.h>
 #endif
Index: include/httpd.h
===================================================================
RCS file: /cvs/apache-1.3/src/include/httpd.h,v
retrieving revision 1.228
diff -u -r1.228 httpd.h
--- httpd.h	1998/07/18 23:35:40	1.228
+++ httpd.h	1998/08/03 04:41:38
@@ -79,7 +79,7 @@
  * file with a relative pathname will have this added.
  */
 #ifndef HTTPD_ROOT
-#ifdef __EMX__
+#ifdef OS2
 /* Set default for OS/2 file system */
 #define HTTPD_ROOT "/os2httpd"
 #elif defined(WIN32)
@@ -94,7 +94,7 @@
  * directive.
  */
 #ifndef DOCUMENT_LOCATION
-#ifdef __EMX__
+#ifdef OS2
 /* Set default for OS/2 file system */
 #define DOCUMENT_LOCATION  HTTPD_ROOT "/docs"
 #else
@@ -144,7 +144,7 @@
 
 /* The name of the log files */
 #ifndef DEFAULT_XFERLOG
-#ifdef __EMX__
+#ifdef OS2
 /* Set default for OS/2 file system */
 #define DEFAULT_XFERLOG "logs/access.log"
 #else
@@ -153,7 +153,7 @@
 #endif /* DEFAULT_XFERLOG */
 
 #ifndef DEFAULT_ERRORLOG
-#ifdef __EMX__
+#ifdef OS2
 /* Set default for OS/2 file system */
 #define DEFAULT_ERRORLOG "logs/error.log"
 #else
@@ -189,7 +189,7 @@
 
 /* Define this to be what your per-directory security files are called */
 #ifndef DEFAULT_ACCESS_FNAME
-#ifdef __EMX__
+#ifdef OS2
 /* Set default for OS/2 file system */
 #define DEFAULT_ACCESS_FNAME "htaccess"
 #else
@@ -233,7 +233,7 @@
 
 /* The path to the shell interpreter, for parsed docs */
 #ifndef SHELL_PATH
-#if defined(__EMX__) || defined(WIN32)
+#if defined(OS2) || defined(WIN32)
 /* Set default for OS/2 and Windows file system */
 #define SHELL_PATH "CMD.EXE"
 #else
@@ -889,7 +889,7 @@
 API_EXPORT(int) ap_strcmp_match(const char *str, const char *exp);
 API_EXPORT(int) ap_strcasecmp_match(const char *str, const char *exp);
 API_EXPORT(char *) ap_uudecode(pool *, const char *);
-#ifdef __EMX__
+#ifdef OS2
 void os2pathname(char *path);
 #endif
 
Index: main/alloc.c
===================================================================
RCS file: /cvs/apache-1.3/src/main/alloc.c,v
retrieving revision 1.97
diff -u -r1.97 alloc.c
--- alloc.c	1998/07/27 14:58:19	1.97
+++ alloc.c	1998/08/03 04:41:59
@@ -1800,7 +1800,7 @@
 #endif /* WIN32 */
 
 /* for ap_fdopen, to get binary mode */
-#if defined (__EMX__) || defined (WIN32)
+#if defined (OS2) || defined (WIN32)
 #define BINMODE	"b"
 #else
 #define BINMODE
Index: main/http_core.c
===================================================================
RCS file: /cvs/apache-1.3/src/main/http_core.c,v
retrieving revision 1.213
diff -u -r1.213 http_core.c
--- http_core.c	1998/07/23 10:46:23	1.213
+++ http_core.c	1998/08/03 04:42:20
@@ -332,7 +332,7 @@
  * See directory_walk().
  */
 
-#if defined(__EMX__) || defined(WIN32)
+#if defined(OS2) || defined(WIN32)
 #define IS_SPECIAL(entry_core)	\
     ((entry_core)->r != NULL \
 	|| ((entry_core)->d[0] != '/' && (entry_core)->d[1] != ':'))
@@ -1126,7 +1126,7 @@
     }
 
     cmd->path = ap_getword_conf(cmd->pool, &arg);
-#ifdef __EMX__
+#ifdef OS2
     /* Fix OS/2 HPFS filename case problem. */
     cmd->path = strlwr(cmd->path);
 #endif    
@@ -1639,7 +1639,7 @@
 		    "requires SUEXEC wrapper.\n");
 	}
     }
-#if !defined (BIG_SECURITY_HOLE) && !defined (__EMX__)
+#if !defined (BIG_SECURITY_HOLE) && !defined (OS2)
     if (cmd->server->server_uid == 0) {
 	fprintf(stderr,
 		"Error:\tApache has not been designed to serve pages while\n"
@@ -2594,7 +2594,7 @@
         return METHOD_NOT_ALLOWED;
     }
 	
-#if defined(__EMX__) || defined(WIN32)
+#if defined(OS2) || defined(WIN32)
     /* Need binary mode for OS/2 */
     f = ap_pfopen(r->pool, r->filename, "rb");
 #else
Index: main/http_log.c
===================================================================
RCS file: /cvs/apache-1.3/src/main/http_log.c,v
retrieving revision 1.61
diff -u -r1.61 http_log.c
--- http_log.c	1998/06/04 20:13:19	1.61
+++ http_log.c	1998/08/03 04:42:33
@@ -170,7 +170,7 @@
 #if defined(WIN32)
     child_pid = spawnl (_P_NOWAIT, SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL);
     return(child_pid);
-#elif defined(__EMX__)
+#elif defined(OS2)
     /* For OS/2 we need to use a '/' */
     execl (SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL);
 #else    
@@ -635,7 +635,7 @@
 #if defined(WIN32)
     child_pid = spawnl (_P_NOWAIT, SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL);
     return(child_pid);
-#elif defined(__EMX__)
+#elif defined(OS2)
     /* For OS/2 we need to use a '/' */
     execl (SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL);
 #else
Index: main/http_main.c
===================================================================
RCS file: /cvs/apache-1.3/src/main/http_main.c,v
retrieving revision 1.376
diff -u -r1.376 http_main.c
--- http_main.c	1998/08/02 04:43:17	1.376
+++ http_main.c	1998/08/03 04:43:19
@@ -2696,7 +2697,7 @@
     int x;
 
     chdir("/");
-#if !defined(MPE) && !defined(__EMX__)
+#if !defined(MPE) && !defined(OS2)
 /* Don't detach for MPE because child processes can't survive the death of
    the parent. */
     if ((x = fork()) > 0)
@@ -2720,7 +2721,7 @@
 	fprintf(stderr, "httpd: setpgrp or getpgrp failed\n");
 	exit(1);
     }
-#elif defined(__EMX__)
+#elif defined(OS2)
     /* OS/2 don't support process group IDs */
     pgrp = getpid();
 #elif defined(MPE)
@@ -2787,7 +2788,7 @@
 	else
 	    name = ap_user_name;
 
-#ifndef __EMX__
+#ifndef OS2
 	/* OS/2 dosen't support groups. */
 
 	/* Reset `groups' attributes. */
@@ -3432,7 +3433,7 @@
      * a signal or a timeout (yeah, I know, same thing).
      */
     ap_setjmp(jmpbuffer);
-#ifndef __EMX__
+#ifndef OS2
 #ifdef SIGURG
     signal(SIGURG, timeout);
 #endif
@@ -3440,7 +3441,7 @@
     signal(SIGPIPE, timeout);
     signal(SIGALRM, alrm_handler);
 
-#ifdef __EMX__
+#ifdef OS2
 /* Stop Ctrl-C/Ctrl-Break signals going to child processes */
     {
         unsigned long ulTimes;
@@ -4059,7 +4060,7 @@
 {
     int remaining_children_to_start;
 
-#ifdef __EMX__
+#ifdef OS2
     printf("%s \n", ap_get_server_version());
 #endif
 
@@ -5576,7 +5577,7 @@
     ap_open_logs(server_conf, pconf);
     set_group_privs();
 
-#ifdef __EMX__
+#ifdef OS2
     printf("%s \n", ap_get_server_version());
 #endif
 #ifdef WIN32
Index: main/http_protocol.c
===================================================================
RCS file: /cvs/apache-1.3/src/main/http_protocol.c,v
retrieving revision 1.227
diff -u -r1.227 http_protocol.c
--- http_protocol.c	1998/08/02 04:43:18	1.227
+++ http_protocol.c	1998/08/03 04:43:32
@@ -599,7 +599,7 @@
 	r->args = r->parsed_uri.query;
 	r->uri = r->parsed_uri.path ? r->parsed_uri.path
 				    : ap_pstrdup(r->pool, "/");
-#if defined(__EMX__) || defined(WIN32)
+#if defined(OS2) || defined(WIN32)
 	/* Handle path translations for OS/2 and plug security hole.
 	 * This will prevent "http://www.wherever.com/..\..\/" from
 	 * returning a directory for the root drive.
@@ -614,7 +614,7 @@
 	    ap_str_tolower(r->uri);
 #endif
 	}
-#endif  /* __EMX__ || WIN32 */
+#endif  /* OS2 || WIN32 */
     }
     else {
 	r->args = NULL;
Index: main/http_request.c
===================================================================
RCS file: /cvs/apache-1.3/src/main/http_request.c,v
retrieving revision 1.125
diff -u -r1.125 http_request.c
--- http_request.c	1998/07/01 21:19:54	1.125
+++ http_request.c	1998/08/03 04:43:39
@@ -112,7 +112,7 @@
 
 static int check_symlinks(char *d, int opts)
 {
-#if defined(__EMX__) || defined(WIN32)
+#if defined(OS2) || defined(WIN32)
     /* OS/2 doesn't have symlinks */
     return OK;
 #else
Index: main/util.c
===================================================================
RCS file: /cvs/apache-1.3/src/main/util.c,v
retrieving revision 1.125
diff -u -r1.125 util.c
--- util.c	1998/07/28 17:07:14	1.125
+++ util.c	1998/08/03 04:43:45
@@ -1064,7 +1064,7 @@
     s = (const unsigned char *)str;
     for (; *s; ++s) {
 
-#if defined(__EMX__) || defined(WIN32)
+#if defined(OS2) || defined(WIN32)
 	/* Don't allow '&' in parameters under OS/2. */
 	/* This can be used to send commands to the shell. */
 	if (*s == '&') {
@@ -1323,7 +1323,7 @@
 #ifdef MULTIPLE_GROUPS
     int cnt;
 #endif
-#if defined(__EMX__) || defined(WIN32)
+#if defined(OS2) || defined(WIN32)
     /* OS/2 dosen't have Users and Groups */
     return 1;
 #else
@@ -1734,7 +1734,7 @@
     return bufplain;
 }
 
-#ifdef __EMX__
+#ifdef OS2
 void os2pathname(char *path)
 {
     char newpath[MAX_STRING_LEN];
Index: main/util_script.c
===================================================================
RCS file: /cvs/apache-1.3/src/main/util_script.c,v
retrieving revision 1.122
diff -u -r1.122 util_script.c
--- util_script.c	1998/07/10 08:33:36	1.122
+++ util_script.c	1998/08/03 04:43:48
@@ -597,7 +597,7 @@
     }
 }
 
-#if defined(__EMX__) || defined(WIN32)
+#if defined(OS2) || defined(WIN32)
 static char **create_argv_cmd(pool *p, char *av0, const char *args, char *path)
 {
     register int x, n;
@@ -695,7 +695,7 @@
     }
 #endif
 
-#ifdef __EMX__
+#ifdef OS2
     {
 	/* Additions by Alec Kloss, to allow exec'ing of scripts under OS/2 */
 	int is_script;
Index: modules/proxy/proxy_cache.c
===================================================================
RCS file: /cvs/apache-1.3/src/modules/proxy/proxy_cache.c,v
retrieving revision 1.47
diff -u -r1.47 proxy_cache.c
--- proxy_cache.c	1998/07/28 16:59:11	1.47
+++ proxy_cache.c	1998/08/03 04:43:52
@@ -118,7 +118,7 @@
 static int sub_garbage_coll(request_rec *r, array_header *files,
 			    const char *cachedir, const char *cachesubdir);
 static void help_proxy_garbage_coll(request_rec *r);
-#if !defined(WIN32) && !defined(MPE) && !defined(__EMX__)
+#if !defined(WIN32) && !defined(MPE) && !defined(OS2)
 static void detached_proxy_garbage_coll(request_rec *r);
 #endif
 
@@ -137,7 +137,7 @@
     (void) ap_release_mutex(garbage_mutex);
 
     ap_block_alarms();		/* avoid SIGALRM on big cache cleanup */
-#if !defined(WIN32) && !defined(MPE) && !defined(__EMX__)
+#if !defined(WIN32) && !defined(MPE) && !defined(OS2)
     detached_proxy_garbage_coll(r);
 #else
     help_proxy_garbage_coll(r);
@@ -197,7 +197,7 @@
 	return 0;
 }
 
-#if !defined(WIN32) && !defined(MPE) && !defined(__EMX__)
+#if !defined(WIN32) && !defined(MPE) && !defined(OS2)
 static void detached_proxy_garbage_coll(request_rec *r)
 {
     pid_t pid;
@@ -423,7 +423,7 @@
 	/*      if (strlen(ent->d_name) != HASH_LEN) continue; */
 
 /* under OS/2 use dirent's d_attr to identify a diretory */
-#ifdef __EMX__
+#ifdef OS2
 /* is it a directory? */
 	if (ent->d_attr & A_DIR) {
 	    char newcachedir[HUGE_STRING_LEN];
@@ -459,7 +459,7 @@
 	}
 
 /* In OS/2 this has already been done above */
-#ifndef __EMX__
+#ifndef OS2
 	if (S_ISDIR(buf.st_mode)) {
 	    char newcachedir[HUGE_STRING_LEN];
 	    close(fd);
@@ -1117,7 +1117,7 @@
 	    *p = '/';
 	    ++p;
 	}
-#if defined(__EMX__) || defined(WIN32)
+#if defined(OS2) || defined(WIN32)
 	/* Under OS/2 use rename. */
 	if (rename(c->tempfile, c->filename) == -1)
 	    ap_log_error(APLOG_MARK, APLOG_ERR, s,
Index: modules/standard/mod_cgi.c
===================================================================
RCS file: /cvs/apache-1.3/src/modules/standard/mod_cgi.c,v
retrieving revision 1.82
diff -u -r1.82 mod_cgi.c
--- mod_cgi.c	1998/06/27 18:09:31	1.82
+++ mod_cgi.c	1998/08/03 04:43:56
@@ -289,7 +289,7 @@
     int child_pid;
 
 #ifdef DEBUG_CGI
-#ifdef __EMX__
+#ifdef OS2
     /* Under OS/2 need to use device con. */
     FILE *dbg = fopen("con", "w");
 #else
@@ -382,7 +382,7 @@
 	return log_scripterror(r, conf, FORBIDDEN, APLOG_NOERRNO,
 			       "attempt to include NPH CGI script");
 
-#if defined(__EMX__) || defined(WIN32)
+#if defined(OS2) || defined(WIN32)
     /* Allow for cgi files without the .EXE extension on them under OS/2 */
     if (r->finfo.st_mode == 0) {
 	struct stat statbuf;
Index: modules/standard/mod_include.c
===================================================================
RCS file: /cvs/apache-1.3/src/modules/standard/mod_include.c,v
retrieving revision 1.99
diff -u -r1.99 mod_include.c
--- mod_include.c	1998/07/20 16:33:57	1.99
+++ mod_include.c	1998/08/03 04:44:02
@@ -754,7 +754,7 @@
 #endif
 
 #ifdef DEBUG_INCLUDE_CMD
-#ifdef __EMX__
+#ifdef OS2
     /* under OS/2 /dev/tty is referenced as con */
     FILE *dbg = fopen("con", "w");
 #else
@@ -2309,7 +2309,7 @@
     }
 
     if ((*state == xbithack_full)
-#if !defined(__EMX__) && !defined(WIN32)
+#if !defined(OS2) && !defined(WIN32)
     /*  OS/2 dosen't support Groups. */
         && (r->finfo.st_mode & S_IXGRP)
 #endif
@@ -2380,7 +2380,7 @@
 
 static int xbithack_handler(request_rec *r)
 {
-#if defined(__EMX__) || defined(WIN32)
+#if defined(OS2) || defined(WIN32)
     /* OS/2 dosen't currently support the xbithack. This is being worked on. */
     return DECLINED;
 #else
Index: modules/standard/mod_log_agent.c
===================================================================
RCS file: /cvs/apache-1.3/src/modules/standard/mod_log_agent.c,v
retrieving revision 1.29
diff -u -r1.29 mod_log_agent.c
--- mod_log_agent.c	1998/06/14 21:10:26	1.29
+++ mod_log_agent.c	1998/08/03 04:44:02
@@ -63,7 +63,7 @@
 module agent_log_module;
 
 static int xfer_flags = (O_WRONLY | O_APPEND | O_CREAT);
-#ifdef __EMX__
+#ifdef OS2
 /* OS/2 dosen't support users and groups */
 static mode_t xfer_mode = (S_IREAD | S_IWRITE);
 #else
Index: modules/standard/mod_log_config.c
===================================================================
RCS file: /cvs/apache-1.3/src/modules/standard/mod_log_config.c,v
retrieving revision 1.65
diff -u -r1.65 mod_log_config.c
--- mod_log_config.c	1998/07/08 17:47:16	1.65
+++ mod_log_config.c	1998/08/03 04:44:05
@@ -176,7 +176,7 @@
 module MODULE_VAR_EXPORT config_log_module;
 
 static int xfer_flags = (O_WRONLY | O_APPEND | O_CREAT);
-#if defined(__EMX__) || defined(WIN32)
+#if defined(OS2) || defined(WIN32)
 /* OS/2 dosen't support users and groups */
 static mode_t xfer_mode = (S_IREAD | S_IWRITE);
 #else
Index: modules/standard/mod_log_referer.c
===================================================================
RCS file: /cvs/apache-1.3/src/modules/standard/mod_log_referer.c,v
retrieving revision 1.32
diff -u -r1.32 mod_log_referer.c
--- mod_log_referer.c	1998/06/14 21:10:27	1.32
+++ mod_log_referer.c	1998/08/03 04:44:05
@@ -64,7 +64,7 @@
 
 static int xfer_flags = (O_WRONLY | O_APPEND | O_CREAT);
 
-#ifdef __EMX__
+#ifdef OS2
 /* OS/2 lacks support for users and groups */
 static mode_t xfer_mode = (S_IREAD | S_IWRITE);
 #else
Index: modules/standard/mod_rewrite.c
===================================================================
RCS file: /cvs/apache-1.3/src/modules/standard/mod_rewrite.c,v
retrieving revision 1.126
diff -u -r1.126 mod_rewrite.c
--- mod_rewrite.c	1998/07/23 11:34:00	1.126
+++ mod_rewrite.c	1998/08/03 04:44:16
@@ -2173,7 +2173,7 @@
         }
     }
     else if (strcmp(p->pattern, "-l") == 0) {
-#if !defined(__EMX__) && !defined(WIN32)
+#if !defined(OS2) && !defined(WIN32)
         if (lstat(input, &sb) == 0) {
             if (S_ISLNK(sb.st_mode)) {
                 rc = 1;
@@ -3232,7 +3232,7 @@
                      "file %s", conf->rewritelockfile);
         exit(1);
     }
-#if !defined(__EMX__) && !defined(WIN32)
+#if !defined(OS2) && !defined(WIN32)
     /* make sure the childs have access to this file */
     if (geteuid() == 0 /* is superuser */)
         chown(conf->rewritelockfile, ap_user_id, -1 /* no gid change */);
@@ -3411,7 +3411,7 @@
             child_pid = pi.dwProcessId;
         }
     }
-#elif defined(__EMX__)
+#elif defined(OS2)
     /* IBM OS/2 */
     execl(SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL);
 #else
Index: modules/standard/mod_status.c
===================================================================
RCS file: /cvs/apache-1.3/src/modules/standard/mod_status.c,v
retrieving revision 1.89
diff -u -r1.89 mod_status.c
--- mod_status.c	1998/06/15 16:46:13	1.89
+++ mod_status.c	1998/08/03 04:44:19
@@ -614,7 +614,7 @@
     }				/* for () */
 
     if (!(short_report || no_table_report)) {
-#ifdef __EMX__
+#ifdef OS2
 	ap_rputs("</table>\n \
 <hr> \
 <table>\n \
Index: modules/standard/mod_userdir.c
===================================================================
RCS file: /cvs/apache-1.3/src/modules/standard/mod_userdir.c,v
retrieving revision 1.36
diff -u -r1.36 mod_userdir.c
--- mod_userdir.c	1998/04/13 18:05:16	1.36
+++ mod_userdir.c	1998/08/03 04:44:20
@@ -296,7 +296,7 @@
 #else                           /* WIN32 */
             struct passwd *pw;
             if ((pw = getpwnam(w))) {
-#ifdef __EMX__
+#ifdef OS2
                 /* Need to manually add user name for OS/2 */
                 filename = ap_pstrcat(r->pool, pw->pw_dir, w, "/", userdir, NULL);
 #else
Index: support/htdigest.c
===================================================================
RCS file: /cvs/apache-1.3/src/support/htdigest.c,v
retrieving revision 1.18
diff -u -r1.18 htdigest.c
--- htdigest.c	1998/07/13 11:32:58	1.18
+++ htdigest.c	1998/08/03 04:44:24
@@ -196,7 +196,7 @@
     }
     fclose(f);
     fclose(tfp);
-#if defined(__EMX__) || defined(WIN32)
+#if defined(OS2) || defined(WIN32)
     sprintf(command, "copy \"%s\" \"%s\"", tn, argv[1]);
 #else
     sprintf(command, "cp %s %s", tn, argv[1]);
Index: support/rotatelogs.c
===================================================================
RCS file: /cvs/apache-1.3/src/support/rotatelogs.c,v
retrieving revision 1.10
diff -u -r1.10 rotatelogs.c
--- rotatelogs.c	1998/07/13 11:32:58	1.10
+++ rotatelogs.c	1998/08/03 04:44:24
@@ -28,7 +28,7 @@
 	fprintf(stderr,
 		"%s <logfile> <rotation time in seconds>\n\n",
 		argv[0]);
-#ifdef __EMX__
+#ifdef OS2
 	fprintf(stderr,
 		"Add this:\n\nTransferLog \"|%s.exe /some/where 86400\"\n\n",
 		argv[0]);

--
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


Mime
View raw message