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
;;
-none)
;;
+ -os2)
+ ;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
-# 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
fi
case "$host_os" in
-cygwin32)
+cygwin32|os2)
exec_suffix=".exe"
cgi_suffix=".exe"
;;
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)
dnl use .exe suffix for executables on cygwin32 platform
case "$host_os" in
-cygwin32)
+cygwin32|os2)
exec_suffix=".exe"
cgi_suffix=".exe"
;;
#
# 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:
#
./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 "\
/*
- * $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
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;
/*
- * $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
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);
}
/*
- * $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
*
}
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;
/*
- * $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
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
/*
- * $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
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)
/*
- * $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
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");
/*
- * $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
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");
}
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;