Index: src/debug.c =================================================================== RCS file: /cvsroot/squid/squid/src/debug.c,v retrieving revision 1.8 diff -u -p -r1.8 debug.c --- src/debug.c 2001/06/29 22:34:19 1.8 +++ src/debug.c 2001/08/12 10:13:16 @@ -265,6 +265,22 @@ xassert(const char *msg, const char *fil } /* + * Same as rename(2) but complains if something goes wrong; + * the caller is responsible for handing and explaining the + * consequences of errors. + */ +int +xrename(const char *from, const char *to) +{ + debug(21, 2) ("xrename: renaming %s to %s\n", from, to); + if (0 == rename(from, to)) + return 0; + debug(21, errno == ENOENT ? 2 : 1) ("xrename: Cannot rename %s to %s: %s\n", + from, to, xstrerror()); + return -1; +} + +/* * Context-based Debugging * * Rationale Index: src/protos.h =================================================================== RCS file: /cvsroot/squid/squid/src/protos.h,v retrieving revision 1.30 diff -u -p -r1.30 protos.h --- src/protos.h 2001/07/28 22:34:19 1.30 +++ src/protos.h 2001/08/12 10:13:18 @@ -207,6 +207,7 @@ extern void _db_print(const char *,...); extern void _db_print(); #endif extern void xassert(const char *, const char *, int); +extern int xrename(const char *from, const char *to); /* packs, then prints an object using debug() */ extern void debugObj(int section, int level, const char *label, void *obj, ObjPackMethod pm); @@ -1148,7 +1149,6 @@ extern int stringHasWhitespace(const cha extern int stringHasCntl(const char *); extern void linklistPush(link_list **, void *); extern void *linklistShift(link_list **); -extern int xrename(const char *from, const char *to); extern int isPowTen(int); extern void parseEtcHosts(void); Index: src/tools.c =================================================================== RCS file: /cvsroot/squid/squid/src/tools.c,v retrieving revision 1.13 diff -u -p -r1.13 tools.c --- src/tools.c 2001/04/27 16:24:56 1.13 +++ src/tools.c 2001/08/12 10:13:18 @@ -912,22 +912,6 @@ linklistShift(link_list ** L) return p; } -/* - * Same as rename(2) but complains if something goes wrong; - * the caller is responsible for handing and explaining the - * consequences of errors. - */ -int -xrename(const char *from, const char *to) -{ - debug(21, 2) ("xrename: renaming %s to %s\n", from, to); - if (0 == rename(from, to)) - return 0; - debug(21, errno == ENOENT ? 2 : 1) ("xrename: Cannot rename %s to %s: %s\n", - from, to, xstrerror()); - return -1; -} - int stringHasCntl(const char *s) {