|
Lines 270-275
tty_make_modes(int fd, struct termios *t
Link Here
|
| 270 |
} |
270 |
} |
| 271 |
|
271 |
|
| 272 |
if (tiop == NULL) { |
272 |
if (tiop == NULL) { |
|
|
273 |
if (fd == -1) { |
| 274 |
debug("tty_make_modes: no fd or tio"); |
| 275 |
goto end; |
| 276 |
} |
| 273 |
if (tcgetattr(fd, &tio) == -1) { |
277 |
if (tcgetattr(fd, &tio) == -1) { |
| 274 |
logit("tcgetattr: %.100s", strerror(errno)); |
278 |
logit("tcgetattr: %.100s", strerror(errno)); |
| 275 |
goto end; |
279 |
goto end; |
|
Lines 289-300
tty_make_modes(int fd, struct termios *t
Link Here
|
| 289 |
|
293 |
|
| 290 |
/* Store values of mode flags. */ |
294 |
/* Store values of mode flags. */ |
| 291 |
#define TTYCHAR(NAME, OP) \ |
295 |
#define TTYCHAR(NAME, OP) \ |
| 292 |
debug3("tty_make_modes: %d %d", OP, tio.c_cc[NAME]); \ |
|
|
| 293 |
buffer_put_char(&buf, OP); \ |
296 |
buffer_put_char(&buf, OP); \ |
| 294 |
put_arg(&buf, tio.c_cc[NAME]); |
297 |
put_arg(&buf, tio.c_cc[NAME]); |
| 295 |
|
298 |
|
| 296 |
#define TTYMODE(NAME, FIELD, OP) \ |
299 |
#define TTYMODE(NAME, FIELD, OP) \ |
| 297 |
debug3("tty_make_modes: %d %d", OP, ((tio.FIELD & NAME) != 0)); \ |
|
|
| 298 |
buffer_put_char(&buf, OP); \ |
300 |
buffer_put_char(&buf, OP); \ |
| 299 |
put_arg(&buf, ((tio.FIELD & NAME) != 0)); |
301 |
put_arg(&buf, ((tio.FIELD & NAME) != 0)); |
| 300 |
|
302 |
|
|
Lines 382-388
tty_parse_modes(int fd, int *n_bytes_ptr
Link Here
|
| 382 |
case OP: \ |
384 |
case OP: \ |
| 383 |
n_bytes += arg_size; \ |
385 |
n_bytes += arg_size; \ |
| 384 |
tio.c_cc[NAME] = get_arg(); \ |
386 |
tio.c_cc[NAME] = get_arg(); \ |
| 385 |
debug3("tty_parse_modes: %d %d", OP, tio.c_cc[NAME]); \ |
|
|
| 386 |
break; |
387 |
break; |
| 387 |
#define TTYMODE(NAME, FIELD, OP) \ |
388 |
#define TTYMODE(NAME, FIELD, OP) \ |
| 388 |
case OP: \ |
389 |
case OP: \ |
|
Lines 391-397
tty_parse_modes(int fd, int *n_bytes_ptr
Link Here
|
| 391 |
tio.FIELD |= NAME; \ |
392 |
tio.FIELD |= NAME; \ |
| 392 |
else \ |
393 |
else \ |
| 393 |
tio.FIELD &= ~NAME; \ |
394 |
tio.FIELD &= ~NAME; \ |
| 394 |
debug3("tty_parse_modes: %d %d", OP, arg); \ |
|
|
| 395 |
break; |
395 |
break; |
| 396 |
|
396 |
|
| 397 |
#include "ttymodes.h" |
397 |
#include "ttymodes.h" |