/*
- * $Id: acl.cc,v 1.281 2002/08/09 10:57:43 robertc Exp $
+ * $Id: acl.cc,v 1.282 2002/09/01 15:16:33 hno Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
debug(28, 0) ("strtokFile: %s not found\n", fn);
return (NULL);
}
-#if defined(_SQUID_CYGWIN_)
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
setmode(fileno(aclFile), O_TEXT);
#endif
aclFromFile = 1;
/*
- * $Id: cache_cf.cc,v 1.410 2002/09/01 13:54:16 hno Exp $
+ * $Id: cache_cf.cc,v 1.411 2002/09/01 15:16:33 hno Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
if (fp == NULL)
fatalf("Unable to open configuration file: %s: %s",
file_name, xstrerror());
-#if defined(_SQUID_CYGWIN_)
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
setmode(fileno(fp), O_TEXT);
#endif
cfg_filename = file_name;
/*
- * $Id: cache_diff.cc,v 1.15 2001/01/12 00:37:15 wessels Exp $
+ * $Id: cache_diff.cc,v 1.16 2002/09/01 15:16:33 hno Exp $
*
* AUTHOR: Alex Rousskov
*
fprintf(stderr, "cannot open %s: %s\n", fname, strerror(errno));
return 0;
}
-#if defined(_SQUID_CYGWIN_)
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
setmode(fileno(file), O_BINARY);
#endif
scanned_count = cacheIndexScan(idx, fname, file);
/*
- * $Id: cf_gen.cc,v 1.45 2002/08/22 12:29:15 hno Exp $
+ * $Id: cf_gen.cc,v 1.46 2002/09/01 15:16:35 hno Exp $
*
* DEBUG: none Generate squid.conf.default and cf_parser.h
* AUTHOR: Max Okumoto
#if HAVE_ASSERT_H
#include <assert.h>
#endif
-#if defined(_SQUID_CYGWIN_)
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
#include <io.h>
#endif
#if HAVE_FCNTL_H
perror(input_filename);
exit(1);
}
-#if defined(_SQUID_CYGWIN_)
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
setmode(fileno(fp), O_TEXT);
#endif
state = sSTART;
perror(output_filename);
exit(1);
}
-#if defined(_SQUID_CYGWIN_)
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
setmode(fileno(fp), O_TEXT);
#endif
fprintf(fp,
perror(conf_filename);
exit(1);
}
-#if defined(_SQUID_CYGWIN_)
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
setmode(fileno(fp), O_TEXT);
#endif
gen_conf(entries, fp);
/*
- * $Id: client.cc,v 1.99 2002/07/15 21:24:48 hno Exp $
+ * $Id: client.cc,v 1.100 2002/09/01 15:16:35 hno Exp $
*
* DEBUG: section 0 WWW Client
* AUTHOR: Harvest Derived
xstrerror());
exit(-1);
}
-#if defined(_SQUID_CYGWIN_)
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
setmode(put_fd, O_BINARY);
#endif
fstat(put_fd, &sb);
/*
- * $Id: debug.cc,v 1.84 2001/12/17 18:01:54 wessels Exp $
+ * $Id: debug.cc,v 1.85 2002/09/01 15:16:35 hno Exp $
*
* DEBUG: section 0 Debug Routines
* AUTHOR: Harvest Derived
fflush(stderr);
debug_log = stderr;
}
-#if defined(_SQUID_CYGWIN_)
+#if defined(_SQUID_CYGWIN_)||defined(_SQUID_MSWIN_)
setmode(fileno(debug_log), O_TEXT);
#endif
}
snprintf(to, MAXPATHLEN, "%s.%d", debug_log_file, i);
rename(from, to);
}
+/*
+ * You can't rename open files on Microsoft "operating systems"
+ * so we close before renaming.
+ */
+#ifdef _SQUID_MSWIN_
+ if (debug_log != stderr)
+ fclose(debug_log);
+#endif
/* Rotate the current log to .0 */
if (Config.Log.rotateNumber > 0) {
snprintf(to, MAXPATHLEN, "%s.%d", debug_log_file, 0);
/*
- * $Id: disk.cc,v 1.159 2002/08/08 20:12:45 hno Exp $
+ * $Id: disk.cc,v 1.160 2002/09/01 15:16:35 hno Exp $
*
* DEBUG: section 6 Disk I/O Routines
* AUTHOR: Harvest Derived
read_callback(-1, F->read_data);
}
if (F->flags.write_daemon) {
-#if defined(_SQUID_MSWIN_) || defined(_SQUID_OS2_) || defined (_SQUID_CYGWIN_)
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_OS2_) || defined(_SQUID_CYGWIN_)
/*
* on some operating systems, you can not delete or rename
* open files, so we won't allow delayed close.
/*
- * $Id: store_dir_ufs.cc,v 1.48 2002/08/09 10:57:46 robertc Exp $
+ * $Id: store_dir_ufs.cc,v 1.49 2002/09/01 15:16:36 hno Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
char *new_path = xstrdup(storeUfsDirSwapLogFile(sd, ".new"));
int fd;
file_close(ufsinfo->swaplog_fd);
-#if defined (_SQUID_OS2_) || defined (_SQUID_CYGWIN_)
+#if defined(_SQUID_OS2_) || defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_)
if (unlink(swaplog_path) < 0) {
debug(50, 0) ("%s: %s\n", swaplog_path, xstrerror());
fatal("storeUfsDirCloseTmpSwapLog: unlink failed");
fd = state->fd;
/* rename */
if (state->fd >= 0) {
-#if defined(_SQUID_OS2_) || defined (_SQUID_CYGWIN_)
+#if defined(_SQUID_OS2_) || defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_)
file_close(state->fd);
state->fd = -1;
if (unlink(state->cur) < 0)
/*
- * $Id: mime.cc,v 1.102 2001/11/13 17:32:15 hno Exp $
+ * $Id: mime.cc,v 1.103 2002/09/01 15:16:35 hno Exp $
*
* DEBUG: section 25 MIME Parsing
* AUTHOR: Harvest Derived
debug(50, 1) ("mimeInit: %s: %s\n", filename, xstrerror());
return;
}
-#if defined (_SQUID_CYGWIN_)
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
setmode(fileno(fp), O_TEXT);
#endif
mimeFreeMemory();
/*
- * $Id: squid.h,v 1.221 2002/08/09 10:57:43 robertc Exp $
+ * $Id: squid.h,v 1.222 2002/09/01 15:16:35 hno Exp $
*
* AUTHOR: Duane Wessels
*
#if HAVE_LIMITS_H
#include <limits.h>
#endif
-#if defined(_SQUID_CYGWIN_)
+#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_)
#include <io.h>
#endif
/*
- * $Id: tools.cc,v 1.220 2002/08/22 12:29:15 hno Exp $
+ * $Id: tools.cc,v 1.221 2002/09/01 15:16:35 hno Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
xrename(const char *from, const char *to)
{
debug(21, 2) ("xrename: renaming %s to %s\n", from, to);
+#ifdef _SQUID_MSWIN_
+ remove(to);
+#endif
if (0 == rename(from, to))
return 0;
debug(21, errno == ENOENT ? 2 : 1) ("xrename: Cannot rename %s to %s: %s\n",