diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-07-10 18:28:48 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-07-10 18:28:48 (GMT) |
commit | 024b92cb1e7bd2653beee2d010f1baf39010cacc (patch) | |
tree | 22cc01b1a590a7b665cab08e9f3cb7a5b5d67041 | |
parent | f1d34c1b20365bb0c18dcd30218760ea2e65d66b (diff) | |
download | tcl-024b92cb1e7bd2653beee2d010f1baf39010cacc.zip tcl-024b92cb1e7bd2653beee2d010f1baf39010cacc.tar.gz tcl-024b92cb1e7bd2653beee2d010f1baf39010cacc.tar.bz2 |
[Bug 3541646] Don't panic on triggerPipe overrun
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | unix/tclUnixNotfy.c | 10 |
2 files changed, 9 insertions, 5 deletions
@@ -1,3 +1,7 @@ +2012-07-10 Jan Nijtmans <nijtmans@users.sf.net> + + * unix/tclUnixNotfy.c: [Bug 3541646] Don't panic on triggerPipe overrun + 2012-07-10 Donal K. Fellows <dkf@users.sf.net> * win/tclWinSock.c (InitializeHostName): Corrected logic that diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 904c9db..42cc7be 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -340,7 +340,7 @@ Tcl_FinalizeNotifier( */ if (write(triggerPipe, "q", 1) != 1) { - Tcl_Panic("Tcl_FinalizeNotifier: unable to write q to triggerPipe"); + Tcl_Panic("Tcl_FinalizeNotifier: unable to write q to triggerPipe"); } close(triggerPipe); while(triggerPipe >= 0) { @@ -879,8 +879,8 @@ Tcl_WaitForEvent( waitingListPtr = tsdPtr; tsdPtr->onList = 1; - if (write(triggerPipe, "", 1) != 1) { - Tcl_Panic("Tcl_WaitForEvent: unable to write to triggerPipe"); + if ((write(triggerPipe, "", 1) == -1) && (errno != EAGAIN)) { + Tcl_Panic("Tcl_WaitForEvent: unable to write to triggerPipe"); } } @@ -942,8 +942,8 @@ Tcl_WaitForEvent( } tsdPtr->nextPtr = tsdPtr->prevPtr = NULL; tsdPtr->onList = 0; - if (write(triggerPipe, "", 1) != 1) { - Tcl_Panic("Tcl_WaitForEvent: unable to write to triggerPipe"); + if ((write(triggerPipe, "", 1) == -1) && (errno != EAGAIN)) { + Tcl_Panic("Tcl_WaitForEvent: unable to write to triggerPipe"); } } |