summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixNotfy.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2009-12-16 23:25:59 (GMT)
committernijtmans <nijtmans>2009-12-16 23:25:59 (GMT)
commitc09d5284e91311929d7e92c73492076e8a05cd36 (patch)
treeb7038bbc46d46d90860a433594776df4f31d744e /unix/tclUnixNotfy.c
parentcf4896697457a54ad804eebeb31b63e27e41cb6c (diff)
downloadtcl-c09d5284e91311929d7e92c73492076e8a05cd36.zip
tcl-c09d5284e91311929d7e92c73492076e8a05cd36.tar.gz
tcl-c09d5284e91311929d7e92c73492076e8a05cd36.tar.bz2
Fix gcc warning: ignoring return value of ‘write’,
declared with attribute warn_unused_result CONSTify functions TclpGetUserHome and TclSetPreInitScript (TIP #27)
Diffstat (limited to 'unix/tclUnixNotfy.c')
-rw-r--r--unix/tclUnixNotfy.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index edcd884..3be0bb9 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixNotfy.c,v 1.39 2009/04/10 18:02:37 das Exp $
+ * RCS: @(#) $Id: tclUnixNotfy.c,v 1.40 2009/12/16 23:26:00 nijtmans Exp $
*/
#include "tclInt.h"
@@ -291,7 +291,9 @@ Tcl_FinalizeNotifier(
* processes had terminated. [Bug: 4139] [Bug: 1222872]
*/
- write(triggerPipe, "q", 1);
+ if (write(triggerPipe, "q", 1) != 1) {
+ Tcl_Panic("Tcl_FinalizeNotifier: unable to write q to triggerPipe");
+ }
close(triggerPipe);
while(triggerPipe >= 0) {
Tcl_ConditionWait(&notifierCV, &notifierMutex, NULL);
@@ -782,7 +784,9 @@ Tcl_WaitForEvent(
waitingListPtr = tsdPtr;
tsdPtr->onList = 1;
- write(triggerPipe, "", 1);
+ if (write(triggerPipe, "", 1) != 1) {
+ Tcl_Panic("Tcl_FinalizeNotifier: unable to write to triggerPipe");
+ }
}
FD_ZERO(&(tsdPtr->readyMasks.readable));
@@ -812,7 +816,9 @@ Tcl_WaitForEvent(
}
tsdPtr->nextPtr = tsdPtr->prevPtr = NULL;
tsdPtr->onList = 0;
- write(triggerPipe, "", 1);
+ if (write(triggerPipe, "", 1) != 1) {
+ Tcl_Panic("Tcl_FinalizeNotifier: unable to write to triggerPipe");
+ }
}
#else