]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
OS/2 fixes from Doug Nazar nazard@man-assoc.on.ca
authorwessels <>
Thu, 14 Jan 1999 06:24:09 +0000 (06:24 +0000)
committerwessels <>
Thu, 14 Jan 1999 06:24:09 +0000 (06:24 +0000)
12 files changed:
cfgaux/config.guess
cfgaux/config.sub
configure
configure.in
src/Makefile.in
src/cache_manager.cc
src/cf_gen.cc
src/comm_select.cc
src/disk.cc
src/dnsserver.cc
src/main.cc
src/store_dir.cc

index b0f5dca307d6b81cf6591eb94b3952b452dcbdc0..d5da5252310f740de0d6454b03a07a5f97f3698c 100755 (executable)
@@ -555,6 +555,9 @@ EOF
     news*:NEWS-OS:[56].*:*)
        echo mips-sony-newsos${UNAME_RELEASE}
        exit 0 ;;
+    i?86:OS/2:*:*)
+       echo ${UNAME_MACHINE}-ibm-os2
+       exit 0 ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
index 67d8f39aabc44f38f94baea8348d20abc4554186..f751a9eed818ce0e8b4dce7258ce8d1b63aeab94 100755 (executable)
@@ -755,6 +755,8 @@ case $os in
                ;;
        -none)
                ;;
+       -os2)
+               ;;
        *)
                # Get rid of the `-' at the beginning of $os.
                os=`echo $os | sed 's/[^-]*-//'`
index c78c93bf2da602b958a137fd5beb30cbede14f03..26207fbd762bd12c87823b3e2ee0a15592d847bb 100755 (executable)
--- a/configure
+++ b/configure
@@ -587,7 +587,7 @@ fi
 
 
 
-# From configure.in Revision: 1.161 
+# From configure.in Revision: 1.162 
 ac_aux_dir=
 for ac_dir in cfgaux $srcdir/cfgaux; do
   if test -f $ac_dir/install-sh; then
@@ -647,7 +647,7 @@ if test "$libexecdir" = '${exec_prefix}/libexec'; then
 fi
 
 case "$host_os" in
-cygwin32)
+cygwin32|os2)
        exec_suffix=".exe"
        cgi_suffix=".exe"
        ;;
index 659ff484dd6f3ca38661beee74fabe5268e69d5f..8c3ae66a9efc5064231a5e0249a1d73318d1842b 100644 (file)
@@ -3,13 +3,13 @@ dnl  Configuration input file for Squid
 dnl
 dnl  Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
 dnl
-dnl  $Id: configure.in,v 1.162 1999/01/11 20:34:14 wessels Exp $
+dnl  $Id: configure.in,v 1.163 1999/01/13 23:26:05 wessels Exp $
 dnl
 dnl
 dnl
 AC_INIT(src/main.c)
 AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.162 $)dnl
+AC_REVISION($Revision: 1.163 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AC_CONFIG_AUX_DIR(cfgaux)
 
@@ -28,7 +28,7 @@ fi
 
 dnl use .exe suffix for executables on cygwin32 platform
 case "$host_os" in
-cygwin32)
+cygwin32|os2)
        exec_suffix=".exe"
        cgi_suffix=".exe"
        ;;
index 7f8488390a231ca4940bb15f7136cdf7b8e7fb94..d15d3b46759424f70b1d2d6f202de41a7a36b3fe 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Makefile for the Squid Object Cache server
 #
-#  $Id: Makefile.in,v 1.166 1998/12/31 23:50:25 wessels Exp $
+#  $Id: Makefile.in,v 1.167 1999/01/13 23:24:09 wessels Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
@@ -238,7 +238,7 @@ squid.conf cf_parser.c: cf.data cf_gen
        ./cf_gen cf.data
 
 cf_gen: cf_gen.o
-       $(CC) -o $@ cf_gen.o $(STD_APP_LIBS)
+       $(CC) -o $@ $(LDFLAGS) cf_gen.o $(STD_APP_LIBS)
 
 cf.data: cf.data.pre Makefile
        sed "\
index 511bbccd596f579b988042769efc38029cd6f9f5..2ed8eb61e7486805db5dff84360fd0451f604350 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_manager.cc,v 1.18 1998/09/02 17:21:00 wessels Exp $
+ * $Id: cache_manager.cc,v 1.19 1999/01/13 23:24:09 wessels Exp $
  *
  * DEBUG: section 16    Cache Manager Objects
  * AUTHOR: Duane Wessels
@@ -111,6 +111,14 @@ cachemgrParseUrl(const char *url)
     t = sscanf(url, "cache_object://%[^/]/%[^@]@%s", host, request, password);
     if (t < 2) {
        xstrncpy(request, "menu", MAX_URL);
+#ifdef _SQUID_OS2_
+    /*
+     * emx's sscanf insists of returning 2 because it sets request
+     * to null
+     */
+    } else if (request[0] == '\0') {
+       xstrncpy(request, "menu", MAX_URL);
+#endif
     } else if ((a = cachemgrFindAction(request)) == NULL) {
        debug(16, 1) ("cachemgrParseUrl: action '%s' not found\n", request);
        return NULL;
index 57368b1e7a098d1d9cd4f495bd70c8ed24808aa9..a539b5e27842da5c25f3e6f79ab090a8d5e118ec 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cf_gen.cc,v 1.29 1998/11/12 06:27:58 wessels Exp $
+ * $Id: cf_gen.cc,v 1.30 1999/01/13 23:24:10 wessels Exp $
  *
  * DEBUG: none
  * AUTHOR: Max Okumoto
@@ -119,13 +119,18 @@ main(int argc, char *argv[])
     enum State state;
     int rc = 0;
     char *ptr = NULL;
+#ifdef _SQUID_OS2_
+    const char *rmode = "rt";
+#else
+    const char *rmode = "r";
+#endif
 
     /*-------------------------------------------------------------------*
      * Parse input file
      *-------------------------------------------------------------------*/
 
     /* Open input file */
-    if ((fp = fopen(input_filename, "r")) == NULL) {
+    if ((fp = fopen(input_filename, rmode)) == NULL) {
        perror(input_filename);
        exit(1);
     }
index 87dd2516b8a508135b0f2ac1e696cf8ebd59a3d1..56009295afe314bcba47ea749e76cb4d00d5e107 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm_select.cc,v 1.27 1999/01/12 23:52:08 wessels Exp $
+ * $Id: comm_select.cc,v 1.28 1999/01/13 23:24:10 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  *
@@ -610,6 +610,10 @@ comm_select(int msec)
        }
        if (msec > MAX_POLL_TIME)
            msec = MAX_POLL_TIME;
+#ifdef _SQUID_OS2_
+       if (msec < 0)
+           msec = MAX_POLL_TIME;
+#endif
        for (;;) {
            poll_time.tv_sec = msec / 1000;
            poll_time.tv_usec = (msec % 1000) * 1000;
index fba591851740301d7415c4fdfd053cf8dce5a182..50b5de79333e12a7051e6c513c88652aa8b66b4f 100644 (file)
@@ -1,7 +1,7 @@
 
 
 /*
- * $Id: disk.cc,v 1.138 1999/01/12 16:42:16 wessels Exp $
+ * $Id: disk.cc,v 1.139 1999/01/13 23:24:11 wessels Exp $
  *
  * DEBUG: section 6     Disk I/O Routines
  * AUTHOR: Harvest Derived
@@ -143,9 +143,18 @@ file_close(int fd)
        callback(-1, F->read_data);
     }
     if (F->flags.write_daemon) {
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_OS2_)
+       /*
+        * on some operating systems, you can not delete or rename
+        * open files, so we won't allow delayed close.
+        */
+       while (!diskWriteIsComplete(fd))
+           diskHandleWrite(fd, NULL);
+#else
        F->flags.close_request = 1;
        debug(6, 2) ("file_close: FD %d, delaying close\n", fd);
        return;
+#endif
     }
     /*
      * Assert there is no write callback.  Otherwise we might be
index fa460655981da723beec52177cf6a92571ec69ae..784267d33596afe1cc0f17096574929d49169495 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: dnsserver.cc,v 1.55 1998/11/25 09:00:20 wessels Exp $
+ * $Id: dnsserver.cc,v 1.56 1999/01/13 23:24:12 wessels Exp $
  *
  * DEBUG: section 0     DNS Resolver
  * AUTHOR: Harvest Derived
@@ -158,6 +158,11 @@ struct hostent *_res_gethostbyname(char *name);
 
 static struct in_addr no_addr;
 
+#ifdef _SQUID_OS2_
+struct state _res =
+{0};                           /* it's not in any of the libraries */
+#endif
+
 /* error messages from gethostbyname() */
 static char *
 my_h_msgs(int x)
index 57f3dfd5c9ccc786ddec2c26486a9b7acdd25256..a13440234713f8a1f7e68544ac8b04b09762b705 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.283 1999/01/13 21:00:10 wessels Exp $
+ * $Id: main.cc,v 1.284 1999/01/13 23:24:14 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -360,6 +360,9 @@ static void
 setEffectiveUser(void)
 {
     leave_suid();              /* Run as non privilegied user */
+#ifdef _SQUID_OS2_
+    return;
+#endif
     if (geteuid() == 0) {
        debug(0, 0) ("Squid is not safe to run as root!  If you must\n");
        debug(0, 0) ("start Squid as root, then you must configure\n");
index 99a743f9274bceda7372ae910edfeff5ecd85fbd..dff6b8f71b5d581027efb157d9462f6425e6a5bb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir.cc,v 1.83 1998/09/23 15:37:43 wessels Exp $
+ * $Id: store_dir.cc,v 1.84 1999/01/13 23:24:15 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -545,6 +545,12 @@ storeDirCloseTmpSwapLog(int dirn)
     SwapDir *SD = &Config.cacheSwap.swapDirs[dirn];
     int fd;
     file_close(SD->swaplog_fd);
+#ifdef _SQUID_OS2_
+    if (unlink(swaplog_path) < 0) {
+       debug(50, 0) ("%s: %s\n", swaplog_path, xstrerror());
+       fatal("storeDirCloseTmpSwapLog: unlink failed");
+    }
+#endif
     if (rename(new_path, swaplog_path) < 0) {
        debug(50, 0) ("%s,%s: %s\n", new_path, swaplog_path, xstrerror());
        fatal("storeDirCloseTmpSwapLog: rename failed");
@@ -767,25 +773,27 @@ storeDirWriteCleanLogs(int reopen)
     }
     safe_free(outbuf);
     safe_free(outbufoffset);
-#ifdef _SQUID_MSWIN_
     /*
      * You can't rename open files on Microsoft "operating systems"
-     * so we close before renaming.
+     * so we have to close before renaming.
      */
     storeDirCloseSwapLogs();
-#endif
     /* rename */
     for (dirn = 0; dirn < N; dirn++) {
        if (fd[dirn] < 0)
            continue;
+#ifdef _SQUID_OS2_
+       file_close(fd[dirn]);
+       fd[dirn] = -1;
+       if (unlink(cur[dirn]) < 0)
+           debug(50, 0) ("storeDirWriteCleanLogs: unlinkd failed: %s, %s\n",
+               xstrerror(), cur[dirn]);
+#endif
        if (rename(new[dirn], cur[dirn]) < 0) {
            debug(50, 0) ("storeDirWriteCleanLogs: rename failed: %s, %s -> %s\n",
                xstrerror(), new[dirn], cur[dirn]);
        }
     }
-#ifndef _SQUID_MSWIN_
-    storeDirCloseSwapLogs();
-#endif
     if (reopen)
        storeDirOpenSwapLogs();
     stop = squid_curtime;