diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-05-19 09:48:17 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-05-19 09:48:17 +0000 |
commit | 5e25ddb7d369b6785ec3aaa96cbc0521c22aeb0d (patch) | |
tree | 44b7cf5fb706b0816dd4525782ca8c37d07c2f43 /loginutils/getty.c | |
parent | 636a1f85e89432601c59cdc3239fc867b4adf051 (diff) | |
download | busybox-w32-5e25ddb7d369b6785ec3aaa96cbc0521c22aeb0d.tar.gz busybox-w32-5e25ddb7d369b6785ec3aaa96cbc0521c22aeb0d.tar.bz2 busybox-w32-5e25ddb7d369b6785ec3aaa96cbc0521c22aeb0d.zip |
- use STD*_FILENO some more. No object-code changes
Diffstat (limited to 'loginutils/getty.c')
-rw-r--r-- | loginutils/getty.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c index f022aec59..ae183a62b 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c | |||
@@ -344,7 +344,7 @@ static void auto_baud(char *buf, unsigned size_buf, struct termios *tp) | |||
344 | * try to extract the speed of the dial-in call. | 344 | * try to extract the speed of the dial-in call. |
345 | */ | 345 | */ |
346 | sleep(1); | 346 | sleep(1); |
347 | nread = safe_read(0, buf, size_buf - 1); | 347 | nread = safe_read(STDIN_FILENO, buf, size_buf - 1); |
348 | if (nread > 0) { | 348 | if (nread > 0) { |
349 | buf[nread] = '\0'; | 349 | buf[nread] = '\0'; |
350 | for (bp = buf; bp < buf + nread; bp++) { | 350 | for (bp = buf; bp < buf + nread; bp++) { |
@@ -421,7 +421,7 @@ static char *get_logname(char *logname, unsigned size_logname, | |||
421 | while (cp->eol == '\0') { | 421 | while (cp->eol == '\0') { |
422 | 422 | ||
423 | /* Do not report trivial EINTR/EIO errors. */ | 423 | /* Do not report trivial EINTR/EIO errors. */ |
424 | if (read(0, &c, 1) < 1) { | 424 | if (read(STDIN_FILENO, &c, 1) < 1) { |
425 | if (errno == EINTR || errno == EIO) | 425 | if (errno == EINTR || errno == EIO) |
426 | exit(EXIT_SUCCESS); | 426 | exit(EXIT_SUCCESS); |
427 | bb_perror_msg_and_die("%s: read", op->tty); | 427 | bb_perror_msg_and_die("%s: read", op->tty); |
@@ -460,7 +460,7 @@ static char *get_logname(char *logname, unsigned size_logname, | |||
460 | #endif | 460 | #endif |
461 | cp->erase = ascval; /* set erase character */ | 461 | cp->erase = ascval; /* set erase character */ |
462 | if (bp > logname) { | 462 | if (bp > logname) { |
463 | full_write(1, erase[cp->parity], 3); | 463 | full_write(STDOUT_FILENO, erase[cp->parity], 3); |
464 | bp--; | 464 | bp--; |
465 | } | 465 | } |
466 | break; | 466 | break; |
@@ -470,7 +470,7 @@ static char *get_logname(char *logname, unsigned size_logname, | |||
470 | #endif | 470 | #endif |
471 | cp->kill = ascval; /* set kill character */ | 471 | cp->kill = ascval; /* set kill character */ |
472 | while (bp > logname) { | 472 | while (bp > logname) { |
473 | full_write(1, erase[cp->parity], 3); | 473 | full_write(STDOUT_FILENO, erase[cp->parity], 3); |
474 | bp--; | 474 | bp--; |
475 | } | 475 | } |
476 | break; | 476 | break; |
@@ -482,7 +482,7 @@ static char *get_logname(char *logname, unsigned size_logname, | |||
482 | } else if ((int)(bp - logname) >= size_logname - 1) { | 482 | } else if ((int)(bp - logname) >= size_logname - 1) { |
483 | bb_error_msg_and_die("%s: input overrun", op->tty); | 483 | bb_error_msg_and_die("%s: input overrun", op->tty); |
484 | } else { | 484 | } else { |
485 | full_write(1, &c, 1); /* echo the character */ | 485 | full_write(STDOUT_FILENO, &c, 1); /* echo the character */ |
486 | *bp++ = ascval; /* and store it */ | 486 | *bp++ = ascval; /* and store it */ |
487 | } | 487 | } |
488 | break; | 488 | break; |
@@ -715,7 +715,7 @@ int getty_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
715 | /* Write the modem init string and DON'T flush the buffers */ | 715 | /* Write the modem init string and DON'T flush the buffers */ |
716 | if (options.flags & F_INITSTRING) { | 716 | if (options.flags & F_INITSTRING) { |
717 | debug("writing init string\n"); | 717 | debug("writing init string\n"); |
718 | full_write(1, options.initstring, strlen(options.initstring)); | 718 | full_write(STDOUT_FILENO, options.initstring, strlen(options.initstring)); |
719 | } | 719 | } |
720 | 720 | ||
721 | /* Optionally detect the baud rate from the modem status message */ | 721 | /* Optionally detect the baud rate from the modem status message */ |
@@ -731,7 +731,7 @@ int getty_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
731 | char ch; | 731 | char ch; |
732 | 732 | ||
733 | debug("waiting for cr-lf\n"); | 733 | debug("waiting for cr-lf\n"); |
734 | while (safe_read(0, &ch, 1) == 1) { | 734 | while (safe_read(STDIN_FILENO, &ch, 1) == 1) { |
735 | debug("read %x\n", (unsigned char)ch); | 735 | debug("read %x\n", (unsigned char)ch); |
736 | ch &= 0x7f; /* strip "parity bit" */ | 736 | ch &= 0x7f; /* strip "parity bit" */ |
737 | if (ch == '\n' || ch == '\r') | 737 | if (ch == '\n' || ch == '\r') |
@@ -767,7 +767,7 @@ int getty_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
767 | termios_final(&options, &termios, &chardata); | 767 | termios_final(&options, &termios, &chardata); |
768 | 768 | ||
769 | /* Now the newline character should be properly written. */ | 769 | /* Now the newline character should be properly written. */ |
770 | full_write(1, "\n", 1); | 770 | full_write(STDOUT_FILENO, "\n", 1); |
771 | 771 | ||
772 | /* Let the login program take care of password validation. */ | 772 | /* Let the login program take care of password validation. */ |
773 | /* We use PATH because we trust that root doesn't set "bad" PATH, | 773 | /* We use PATH because we trust that root doesn't set "bad" PATH, |