Lines 176-191
Link Here
|
176 |
if (pflg) |
176 |
if (pflg) |
177 |
playback(fscript); |
177 |
playback(fscript); |
178 |
|
178 |
|
179 |
if ((ttyflg = isatty(STDIN_FILENO)) != 0) { |
179 |
if (tcgetattr(STDIN_FILENO, &tt) == -1 || |
180 |
if (tcgetattr(STDIN_FILENO, &tt) == -1) |
180 |
ioctl(STDIN_FILENO, TIOCGWINSZ, &win) == -1) { |
181 |
err(1, "tcgetattr"); |
181 |
if (errno != ENOTTY) /* For debugger. */ |
182 |
if (ioctl(STDIN_FILENO, TIOCGWINSZ, &win) == -1) |
182 |
err(1, "tcgetattr/ioctl"); |
183 |
err(1, "ioctl"); |
183 |
if (openpty(&master, &slave, NULL, NULL, NULL) == -1) |
184 |
if (openpty(&master, &slave, NULL, &tt, &win) == -1) |
|
|
185 |
err(1, "openpty"); |
184 |
err(1, "openpty"); |
186 |
} else { |
185 |
} else { |
187 |
if (openpty(&master, &slave, NULL, NULL, NULL) == -1) |
186 |
if (openpty(&master, &slave, NULL, &tt, &win) == -1) |
188 |
err(1, "openpty"); |
187 |
err(1, "openpty"); |
|
|
188 |
ttyflg = 1; |
189 |
} |
189 |
} |
190 |
|
190 |
|
191 |
if (rawout) |
191 |
if (rawout) |
Lines 433-441
Link Here
|
433 |
struct termios traw; |
433 |
struct termios traw; |
434 |
|
434 |
|
435 |
if (tcgetattr(STDOUT_FILENO, &tt) == -1) { |
435 |
if (tcgetattr(STDOUT_FILENO, &tt) == -1) { |
436 |
if (errno == EBADF) |
436 |
if (errno != ENOTTY) /* For debugger. */ |
437 |
err(1, "%d not valid fd", STDOUT_FILENO); |
437 |
err(1, "tcgetattr"); |
438 |
/* errno == ENOTTY */ |
|
|
439 |
return; |
438 |
return; |
440 |
} |
439 |
} |
441 |
ttyflg = 1; |
440 |
ttyflg = 1; |