diff options
| author | joe <joe> | 2013-03-02 20:06:09 (GMT) | 
|---|---|---|
| committer | joe <joe> | 2013-03-02 20:06:09 (GMT) | 
| commit | f79d7eb841db3038ed0238992ba1fd980ee82cc5 (patch) | |
| tree | 2307591f41b0b888a2d40e945554d5e5d62365a9 /unix/tclUnixChan.c | |
| parent | d9babf8572e5549c989b4a5d19d8948dced26e5f (diff) | |
| download | tcl-f79d7eb841db3038ed0238992ba1fd980ee82cc5.zip tcl-f79d7eb841db3038ed0238992ba1fd980ee82cc5.tar.gz tcl-f79d7eb841db3038ed0238992ba1fd980ee82cc5.tar.bz2  | |
Member TtyState.savedState set in TtyInit() but never subsequently used.
This can go away...
Diffstat (limited to 'unix/tclUnixChan.c')
| -rw-r--r-- | unix/tclUnixChan.c | 29 | 
1 files changed, 10 insertions, 19 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index d61d546..4c1cb05 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -80,8 +80,6 @@ typedef struct FileState {  typedef struct TtyState {      FileState fs;		/* Per-instance state of the file descriptor.  				 * Must be the first field. */ -    struct termios savedState;	/* Initial state of device. Used to reset -				 * state when device closed. */  } TtyState;  /* @@ -1307,32 +1305,25 @@ TtyInit(      int initialize)  {      TtyState *ttyPtr = ckalloc(sizeof(TtyState)); -    int stateUpdated = 0; -    tcgetattr(fd, &ttyPtr->savedState);      if (initialize) { -	struct termios iostate = ttyPtr->savedState; +	struct termios iostate; +	tcgetattr(fd, &iostate);  	if (iostate.c_iflag != IGNBRK  		|| iostate.c_oflag != 0  		|| iostate.c_lflag != 0  		|| iostate.c_cflag & CREAD  		|| iostate.c_cc[VMIN] != 1 -		|| iostate.c_cc[VTIME] != 0) { -	    stateUpdated = 1; -	} -	iostate.c_iflag = IGNBRK; -	iostate.c_oflag = 0; -	iostate.c_lflag = 0; -	SET_BITS(iostate.c_cflag, CREAD); -	iostate.c_cc[VMIN] = 1; -	iostate.c_cc[VTIME] = 0; - -	/* -	 * Only update if we're changing anything to avoid possible blocking. -	 */ +		|| iostate.c_cc[VTIME] != 0)  +	{ +	    iostate.c_iflag = IGNBRK; +	    iostate.c_oflag = 0; +	    iostate.c_lflag = 0; +	    iostate.c_cflag |= CREAD; +	    iostate.c_cc[VMIN] = 1; +	    iostate.c_cc[VTIME] = 0; -	if (stateUpdated) {  	    tcsetattr(fd, TCSADRAIN, &iostate);  	}      }  | 
