summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2013-03-02 07:30:15 (GMT)
committerjenglish <jenglish@flightlab.com>2013-03-02 07:30:15 (GMT)
commite275a746f2b6e66cb1a52d89be1e011e2eb27777 (patch)
tree0fa5174a4ba36804998a92527e30bf77e6a4487b /unix
parentcb6f189d6d5129efb67a28562013de4f96f18bd8 (diff)
downloadtcl-e275a746f2b6e66cb1a52d89be1e011e2eb27777.zip
tcl-e275a746f2b6e66cb1a52d89be1e011e2eb27777.tar.gz
tcl-e275a746f2b6e66cb1a52d89be1e011e2eb27777.tar.bz2
More ifdef shuffling: GETREADQUEUE and GETWRITEQEUE always defined,
dummy implementations return 0 if the requisite ioctls are not present.
Diffstat (limited to 'unix')
-rw-r--r--unix/tclUnixChan.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index 178c0bc..d200924 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -30,10 +30,15 @@
# define GETREADQUEUE(fd, int) ioctl((fd), FIONREAD, &(int))
# elif defined(FIORDCHK)
# define GETREADQUEUE(fd, int) int = ioctl((fd), FIORDCHK, NULL)
-# endif /* FIONREAD */
+# else
+# define GETREADQUEUE(fd, int) int = 0
+# endif
+
# ifdef TIOCOUTQ
# define GETWRITEQUEUE(fd, int) ioctl((fd), TIOCOUTQ, &(int))
-# endif /* TIOCOUTQ */
+# else
+# define GETWRITEQUEUE(fd, int) int = 0
+# endif
# if !defined(CRTSCTS) && defined(CNEW_RTSCTS)
# define CRTSCTS CNEW_RTSCTS
@@ -875,12 +880,8 @@ TtyGetOptionProc(
int inQueue=0, outQueue=0, inBuffered, outBuffered;
valid = 1;
-#ifdef GETREADQUEUE
GETREADQUEUE(fsPtr->fd, inQueue);
-#endif /* GETREADQUEUE */
-#ifdef GETWRITEQUEUE
GETWRITEQUEUE(fsPtr->fd, outQueue);
-#endif /* GETWRITEQUEUE */
inBuffered = Tcl_InputBuffered(fsPtr->channel);
outBuffered = Tcl_OutputBuffered(fsPtr->channel);