diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2007-04-16 13:36:33 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2007-04-16 13:36:33 (GMT) |
commit | 3b2f0df2b4603b0565ad30e1e15ae9f0bfe3cb5f (patch) | |
tree | 88437ef1c667959b00a3b86ee638cc3a94300aab /win/tclWinChan.c | |
parent | b443cf5d2f6f6c75dc77a88987ed558a2fca9ba5 (diff) | |
download | tcl-3b2f0df2b4603b0565ad30e1e15ae9f0bfe3cb5f.zip tcl-3b2f0df2b4603b0565ad30e1e15ae9f0bfe3cb5f.tar.gz tcl-3b2f0df2b4603b0565ad30e1e15ae9f0bfe3cb5f.tar.bz2 |
Complete the purge of K&R function definitions from manually-written code.
Diffstat (limited to 'win/tclWinChan.c')
-rw-r--r-- | win/tclWinChan.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/win/tclWinChan.c b/win/tclWinChan.c index f07c192..6c74b6c 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinChan.c,v 1.48 2006/08/30 19:30:25 hobbs Exp $ + * RCS: @(#) $Id: tclWinChan.c,v 1.49 2007/04/16 13:36:36 dkf Exp $ */ #include "tclWinInt.h" @@ -1460,26 +1460,28 @@ FileThreadActionProc( */ DWORD -FileGetType(handle) - HANDLE handle; /* Opened file handle */ +FileGetType( + HANDLE handle) /* Opened file handle */ { DWORD type; type = GetFileType(handle); /* - * If the file is a character device, we need to try to figure out - * whether it is a serial port, a console, or something else. We - * test for the console case first because this is more common. + * If the file is a character device, we need to try to figure out whether + * it is a serial port, a console, or something else. We test for the + * console case first because this is more common. */ if ((type == FILE_TYPE_CHAR) || ((type == FILE_TYPE_UNKNOWN) && !GetLastError())) { DWORD consoleParams; + if (GetConsoleMode(handle, &consoleParams)) { type = FILE_TYPE_CONSOLE; } else { DCB dcb; + dcb.DCBlength = sizeof(DCB); if (GetCommState(handle, &dcb)) { type = FILE_TYPE_SERIAL; |