diff options
| author | jenglish@flightlab.com <jenglish> | 2008-02-28 20:12:09 (GMT) |
|---|---|---|
| committer | jenglish@flightlab.com <jenglish> | 2008-02-28 20:12:09 (GMT) |
| commit | 1442bf11852bdc6fe8b95dc7d8255061b7d2ce23 (patch) | |
| tree | aa41a586696a80054db4e5e47d019b5e80c80923 /unix/tclUnixNotfy.c | |
| parent | 52efbb6354bdce8bcf82a9d9e40485efcd60fa77 (diff) | |
| download | tcl-1442bf11852bdc6fe8b95dc7d8255061b7d2ce23.zip tcl-1442bf11852bdc6fe8b95dc7d8255061b7d2ce23.tar.gz tcl-1442bf11852bdc6fe8b95dc7d8255061b7d2ce23.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. |
