From f5556535dc210e0697925ed3d1d446c4f34b7a61 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 24 Oct 2012 11:14:51 +0000 Subject: Add dummy 0 parameter (unused flags) to internal Tcl_FSLoadFileProc call, for upwards compatibility with version 2 filesystems --- generic/tclIOUtil.c | 6 +++++- generic/tclTest.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 69b7e44..cfa01f0 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -2774,6 +2774,9 @@ Tcl_FSChdir(pathPtr) *---------------------------------------------------------------------- */ +typedef int (Tcl_FSLoadFileProc2) (Tcl_Interp *interp, Tcl_Obj *pathPtr, + Tcl_LoadHandle *handlePtr, Tcl_FSUnloadFileProc **unloadProcPtr, int flags); + int Tcl_FSLoadFile(interp, pathPtr, sym1, sym2, proc1Ptr, proc2Ptr, handlePtr, unloadProcPtr) @@ -2797,7 +2800,8 @@ Tcl_FSLoadFile(interp, pathPtr, sym1, sym2, proc1Ptr, proc2Ptr, if (fsPtr != NULL) { Tcl_FSLoadFileProc *proc = fsPtr->loadFileProc; if (proc != NULL) { - int retVal = (*proc)(interp, pathPtr, handlePtr, unloadProcPtr); + int retVal = ((Tcl_FSLoadFileProc2 *)proc) + (interp, pathPtr, handlePtr, unloadProcPtr, 0); if (retVal != TCL_OK) { return retVal; } diff --git a/generic/tclTest.c b/generic/tclTest.c index 8256461..998416c 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -468,7 +468,7 @@ static Tcl_Filesystem testReportingFilesystem = { &TestReportRenameFile, &TestReportCopyDirectory, &TestReportLstat, - &TestReportLoadFile, + (Tcl_FSLoadFileProc *) &TestReportLoadFile, NULL /* cwd */, &TestReportChdir }; -- cgit v0.12 From 188bfaf1aed5fe7441748433f69ccfe434c841f3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 7 Nov 2012 15:28:22 +0000 Subject: needed for complation with mingw-w64 (autoconf still to be run) --- win/configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/win/configure.in b/win/configure.in index f839521..635469b 100644 --- a/win/configure.in +++ b/win/configure.in @@ -119,6 +119,7 @@ AC_CACHE_CHECK(for LPFN_ACCEPT support in winsock2.h, tcl_cv_lpfn_decls, AC_TRY_COMPILE([ #define WIN32_LEAN_AND_MEAN +#define INCL_WINSOCK_API_TYPEDEFS 1 #include #undef WIN32_LEAN_AND_MEAN #include -- cgit v0.12 From ba16c7a4403b1fa99daafb9292751bf572c09616 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 7 Nov 2012 17:24:12 +0000 Subject: 3574493 Avoid hanging on exit due to use of synchronization calls in routines called by DllMain(). --- ChangeLog | 5 +++++ win/tclWinSock.c | 13 +++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f84707..1a372f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-11-07 Don Porter + + * win/tclWinSock.c: [Bug 3574493] Avoid hanging on exit due to + use of synchronization calls in routines called by DllMain(). + 2012-10-03 Don Porter * generic/tclIO.c: When checking for std channels being closed, diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 328198b..050564d 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -659,12 +659,13 @@ TclpFinalizeSockets() if (tsdPtr != NULL) { if (tsdPtr->socketThread != NULL) { if (tsdPtr->hwnd != NULL) { - PostMessage(tsdPtr->hwnd, SOCKET_TERMINATE, 0, 0); - /* - * Wait for the thread to exit. This ensures that we are - * completely cleaned up before we leave this function. - */ - WaitForSingleObject(tsdPtr->readyEvent, INFINITE); + if (PostMessage(tsdPtr->hwnd, SOCKET_TERMINATE, 0, 0)) { + /* + * Wait for the thread to exit. This ensures that we are + * completely cleaned up before we leave this function. + */ + WaitForSingleObject(tsdPtr->readyEvent, INFINITE); + } tsdPtr->hwnd = NULL; } CloseHandle(tsdPtr->socketThread); -- cgit v0.12