--------------------- PatchSet 788 Date: 2003/06/14 10:51:23 Author: serassio Branch: nt Tag: (none) Log: xrename() already try to remove the destination target, so previous unlinks are not needed. Members: src/tools.cc:1.8.2.3->1.8.2.4 src/fs/coss/store_dir_coss.cc:1.8.2.1->1.8.2.2 src/fs/ufs/store_dir_ufs.cc:1.6.2.2->1.6.2.3 Index: squid3/src/tools.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/tools.cc,v retrieving revision 1.8.2.3 retrieving revision 1.8.2.4 diff -u -r1.8.2.3 -r1.8.2.4 --- squid3/src/tools.cc 30 Apr 2003 10:19:28 -0000 1.8.2.3 +++ squid3/src/tools.cc 14 Jun 2003 10:51:23 -0000 1.8.2.4 @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.8.2.3 2003/04/30 10:19:28 serassio Exp $ + * $Id: tools.cc,v 1.8.2.4 2003/06/14 10:51:23 serassio Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -1118,7 +1118,7 @@ xrename(const char *from, const char *to) { debug(21, 2) ("xrename: renaming %s to %s\n", from, to); -#ifdef _SQUID_MSWIN_ +#if defined (_SQUID_OS2_) || defined (_SQUID_WIN32_) remove (to); Index: squid3/src/fs/coss/store_dir_coss.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/coss/store_dir_coss.cc,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -u -r1.8.2.1 -r1.8.2.2 --- squid3/src/fs/coss/store_dir_coss.cc 25 Feb 2003 02:49:23 -0000 1.8.2.1 +++ squid3/src/fs/coss/store_dir_coss.cc 14 Jun 2003 10:51:23 -0000 1.8.2.2 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_coss.cc,v 1.8.2.1 2003/02/25 02:49:23 hno Exp $ + * $Id: store_dir_coss.cc,v 1.8.2.2 2003/06/14 10:51:23 serassio Exp $ * * DEBUG: section 47 Store COSS Directory Routines * AUTHOR: Eric Stern @@ -444,14 +444,6 @@ char *new_path = xstrdup(storeCossDirSwapLogFile(sd, ".new")); int anfd; file_close(sd->swaplog_fd); -#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("storeCossDirCloseTmpSwapLog: unlink failed"); - } - -#endif if (xrename(new_path, swaplog_path) < 0) { fatal("storeCossDirCloseTmpSwapLog: rename failed"); } @@ -692,10 +684,6 @@ file_close(state->fd); state->fd = -1; - if (::unlink(state->cur) < 0) - debug(50, 0) ("storeCossDirWriteCleanLogs: unlinkd failed: %s, %s\n", - xstrerror(), state->cur); - #endif xrename(state->newLog, state->cur); Index: squid3/src/fs/ufs/store_dir_ufs.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/fs/ufs/store_dir_ufs.cc,v retrieving revision 1.6.2.2 retrieving revision 1.6.2.3 diff -u -r1.6.2.2 -r1.6.2.3 --- squid3/src/fs/ufs/store_dir_ufs.cc 25 Apr 2003 07:41:12 -0000 1.6.2.2 +++ squid3/src/fs/ufs/store_dir_ufs.cc 14 Jun 2003 10:51:23 -0000 1.6.2.3 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_ufs.cc,v 1.6.2.2 2003/04/25 07:41:12 serassio Exp $ + * $Id: store_dir_ufs.cc,v 1.6.2.3 2003/06/14 10:51:23 serassio Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -773,14 +773,6 @@ char *new_path = xstrdup(logFile(".new")); int fd; file_close(swaplog_fd); -#if defined (_SQUID_OS2_) || defined (_SQUID_WIN32_) - - if (::unlink(swaplog_path) < 0) { - debug(50, 0) ("%s: %s\n", swaplog_path, xstrerror()); - fatal("commonUfsDirCloseTmpSwapLog: unlink failed"); - } - -#endif if (xrename(new_path, swaplog_path) < 0) { fatal("commonUfsDirCloseTmpSwapLog: rename failed"); } @@ -1024,10 +1016,6 @@ file_close(state->fd); state->fd = -1; - if (::unlink(state->cur) < 0) - debug(50, 0) ("storeDirWriteCleanLogs: unlinkd failed: %s, %s\n", - xstrerror(), state->cur); - #endif xrename(state->newLog, state->cur);