use stty/gtty instead of ioctl
This commit is contained in:
		
							parent
							
								
									d7b7427431
								
							
						
					
					
						commit
						143fe678d4
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		|  | @ -72,10 +72,10 @@ void chan_out(v, c) long v; register chan *c; | ||||||
| 			tty.c_lflag |= (ECHO|ICANON); | 			tty.c_lflag |= (ECHO|ICANON); | ||||||
| 			ioctl(fileno(fp), TCSETA, &tty); | 			ioctl(fileno(fp), TCSETA, &tty); | ||||||
| #else | #else | ||||||
| 			ioctl(fileno(fp), TIOCGETP, &tty); | 			gtty(fileno(fp), &tty); | ||||||
| 			tty.sg_flags&= ~CBREAK; | 			tty.sg_flags&= ~CBREAK; | ||||||
| 			tty.sg_flags|= ECHO|CRMOD; | 			tty.sg_flags|= ECHO|CRMOD; | ||||||
| 			ioctl(fileno(fp), TIOCSETN, &tty); | 			stty(fileno(fp), &tty); | ||||||
| #endif | #endif | ||||||
| 		} else | 		} else | ||||||
| 		if (v==C_F_RAW) { | 		if (v==C_F_RAW) { | ||||||
|  | @ -88,10 +88,10 @@ void chan_out(v, c) long v; register chan *c; | ||||||
| 			tty.c_lflag &= ~(ECHO|ICANON); | 			tty.c_lflag &= ~(ECHO|ICANON); | ||||||
| 			ioctl(fileno(fp), TCSETA, &tty); | 			ioctl(fileno(fp), TCSETA, &tty); | ||||||
| #else | #else | ||||||
| 			ioctl(fileno(fp), TIOCGETP ,&tty); | 			gtty(fileno(fp), ,&tty); | ||||||
| 			tty.sg_flags|= CBREAK; | 			tty.sg_flags|= CBREAK; | ||||||
| 			tty.sg_flags&= ~(ECHO|CRMOD); | 			tty.sg_flags&= ~(ECHO|CRMOD); | ||||||
| 			ioctl(fileno(fp), TIOCSETN, &tty); | 			stty(fileno(fp), &tty); | ||||||
| #endif | #endif | ||||||
| 		} | 		} | ||||||
| 	}	break; | 	}	break; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue