--------------------- PatchSet 5876 Date: 2003/08/17 12:11:47 Author: serassio Branch: nt-2_5 Tag: (none) Log: Fixed a win32 dup2() problem Members: src/comm.c:1.18.6.1.2.8->1.18.6.1.2.9 Index: squid/src/comm.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm.c,v retrieving revision 1.18.6.1.2.8 retrieving revision 1.18.6.1.2.9 diff -u -r1.18.6.1.2.8 -r1.18.6.1.2.9 --- squid/src/comm.c 22 Sep 2002 11:38:05 -0000 1.18.6.1.2.8 +++ squid/src/comm.c 17 Aug 2003 12:11:47 -0000 1.18.6.1.2.9 @@ -1,6 +1,6 @@ /* - * $Id: comm.c,v 1.18.6.1.2.8 2002/09/22 11:38:05 serassio Exp $ + * $Id: comm.c,v 1.18.6.1.2.9 2003/08/17 12:11:47 serassio Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -349,6 +349,11 @@ fdAdjustReserved(); 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()); if (ENFILE == errno || EMFILE == errno)