From: robertc <> Date: Sun, 31 Aug 2003 07:22:05 +0000 (+0000) Subject: Summary: Windows Merges - dup2 and debugging. X-Git-Tag: SQUID_3_0_PRE4~1231 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=68aa427288b26dd399d170107dc4fc39fc0aa451;p=thirdparty%2Fsquid.git Summary: Windows Merges - dup2 and debugging. Keywords: These are 2 residual Windows port merge patches: - main.cc: On Windows signal() can't be used for debugging purpose: added support for native debug - comm.cc: On Windows dup2() can't work correctly on Sockets, the work around is to close the destination socket before call them. Regards Guido --- diff --git a/src/comm.cc b/src/comm.cc index 3e0218503b..08cf8c7ade 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.387 2003/08/15 13:06:34 robertc Exp $ + * $Id: comm.cc,v 1.388 2003/08/31 01:22:05 robertc Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -1407,6 +1407,14 @@ commResetFD(ConnectStateData * cs) return 0; } +#ifdef _SQUID_MSWIN_ + + /* On Windows dup2() can't work correctly on Sockets, the */ + /* workaround is to close the destination Socket before call them. */ + close(cs->fd); + +#endif + if (dup2(fd2, cs->fd) < 0) { debug(5, 0) ("commResetFD: dup2: %s\n", xstrerror()); diff --git a/src/main.cc b/src/main.cc index 8fe67f4dcb..7e11240ddc 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.386 2003/08/17 13:22:30 robertc Exp $ + * $Id: main.cc,v 1.387 2003/08/31 01:22:05 robertc Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -1093,6 +1093,13 @@ main(int argc, char **argv) if (do_reconfigure) { mainReconfigure(); do_reconfigure = 0; +#if defined(_SQUID_MSWIN_) && defined(_DEBUG) + + } else if (do_debug) { + do_debug = 0; + __asm int 3; +#endif + } else if (do_rotate) { mainRotate(); do_rotate = 0;