diff options
author | jenglish <jenglish@flightlab.com> | 2008-02-28 20:12:09 (GMT) |
---|---|---|
committer | jenglish <jenglish@flightlab.com> | 2008-02-28 20:12:09 (GMT) |
commit | 6e9187684c687eab654ee37f1d4a9aa9caff97a2 (patch) | |
tree | aa41a586696a80054db4e5e47d019b5e80c80923 /unix/tclUnixNotfy.c | |
parent | 2b7f76a785b725b2cf77ee239b28c5529e92093f (diff) | |
download | tcl-6e9187684c687eab654ee37f1d4a9aa9caff97a2.zip tcl-6e9187684c687eab654ee37f1d4a9aa9caff97a2.tar.gz tcl-6e9187684c687eab654ee37f1d4a9aa9caff97a2.tar.bz2 |
Consolidate all code conditionalized on -DUSE_FIONBIO into one place.
New routine TclUnixSetBlockingMode().
Diffstat (limited to 'unix/tclUnixNotfy.c')
-rw-r--r-- | unix/tclUnixNotfy.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index 2574015..dba5bd3 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.32 2006/08/21 01:08:03 das Exp $ + * RCS: @(#) $Id: tclUnixNotfy.c,v 1.33 2008/02/28 20:12:09 jenglish Exp $ */ #include "tclInt.h" @@ -918,25 +918,12 @@ NotifierThreadProc( receivePipe = fds[0]; -#ifndef USE_FIONBIO - status = fcntl(receivePipe, F_GETFL); - status |= O_NONBLOCK; - if (fcntl(receivePipe, F_SETFL, status) < 0) { + if (TclUnixSetBlockingMode(receivePipe, TCL_MODE_NONBLOCKING) < 0) { Tcl_Panic("NotifierThreadProc: could not make receive pipe non blocking"); } - status = fcntl(fds[1], F_GETFL); - status |= O_NONBLOCK; - if (fcntl(fds[1], F_SETFL, status) < 0) { + if (TclUnixSetBlockingMode(fds[1], TCL_MODE_NONBLOCKING) < 0) { Tcl_Panic("NotifierThreadProc: could not make trigger pipe non blocking"); } -#else - if (ioctl(receivePipe, (int) FIONBIO, &status) < 0) { - Tcl_Panic("NotifierThreadProc: could not make receive pipe non blocking"); - } - if (ioctl(fds[1], (int) FIONBIO, &status) < 0) { - Tcl_Panic("NotifierThreadProc: could not make trigger pipe non blocking"); - } -#endif /* FIONBIO */ /* * Install the write end of the pipe into the global variable. |