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 /networking/nc_bloaty.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 'networking/nc_bloaty.c')
-rw-r--r-- | networking/nc_bloaty.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/networking/nc_bloaty.c b/networking/nc_bloaty.c index 4ba726eb5..5f7bd0372 100644 --- a/networking/nc_bloaty.c +++ b/networking/nc_bloaty.c | |||
@@ -562,7 +562,7 @@ static int readwrite(void) | |||
562 | /* if we have a timeout AND stdin is closed AND we haven't heard anything | 562 | /* if we have a timeout AND stdin is closed AND we haven't heard anything |
563 | from the net during that time, assume it's dead and close it too. */ | 563 | from the net during that time, assume it's dead and close it too. */ |
564 | if (rr == 0) { | 564 | if (rr == 0) { |
565 | if (!FD_ISSET(0, &ding1)) | 565 | if (!FD_ISSET(STDIN_FILENO, &ding1)) |
566 | netretry--; /* we actually try a coupla times. */ | 566 | netretry--; /* we actually try a coupla times. */ |
567 | if (!netretry) { | 567 | if (!netretry) { |
568 | if (o_verbose > 1) /* normally we don't care */ | 568 | if (o_verbose > 1) /* normally we don't care */ |
@@ -597,12 +597,12 @@ Debug("got %d from the net, errno %d", rr, errno); | |||
597 | goto shovel; | 597 | goto shovel; |
598 | 598 | ||
599 | /* okay, suck more stdin */ | 599 | /* okay, suck more stdin */ |
600 | if (FD_ISSET(0, &ding2)) { /* stdin: ding! */ | 600 | if (FD_ISSET(STDIN_FILENO, &ding2)) { /* stdin: ding! */ |
601 | rr = read(0, bigbuf_in, BIGSIZ); | 601 | rr = read(STDIN_FILENO, bigbuf_in, BIGSIZ); |
602 | /* Considered making reads here smaller for UDP mode, but 8192-byte | 602 | /* Considered making reads here smaller for UDP mode, but 8192-byte |
603 | mobygrams are kinda fun and exercise the reassembler. */ | 603 | mobygrams are kinda fun and exercise the reassembler. */ |
604 | if (rr <= 0) { /* at end, or fukt, or ... */ | 604 | if (rr <= 0) { /* at end, or fukt, or ... */ |
605 | FD_CLR(0, &ding1); /* disable and close stdin */ | 605 | FD_CLR(STDIN_FILENO, &ding1); /* disable and close stdin */ |
606 | close(0); | 606 | close(0); |
607 | } else { | 607 | } else { |
608 | rzleft = rr; | 608 | rzleft = rr; |
@@ -625,7 +625,7 @@ Debug("got %d from the net, errno %d", rr, errno); | |||
625 | return 1; | 625 | return 1; |
626 | } | 626 | } |
627 | if (rnleft) { | 627 | if (rnleft) { |
628 | rr = write(1, np, rnleft); | 628 | rr = write(STDOUT_FILENO, np, rnleft); |
629 | if (rr > 0) { | 629 | if (rr > 0) { |
630 | if (o_ofile) /* log the stdout */ | 630 | if (o_ofile) /* log the stdout */ |
631 | oprint('<', (unsigned char *)np, rr); | 631 | oprint('<', (unsigned char *)np, rr); |
@@ -783,7 +783,7 @@ int nc_main(int argc, char **argv) | |||
783 | } | 783 | } |
784 | #endif | 784 | #endif |
785 | 785 | ||
786 | FD_SET(0, &ding1); /* stdin *is* initially open */ | 786 | FD_SET(STDIN_FILENO, &ding1); /* stdin *is* initially open */ |
787 | if (proggie) { | 787 | if (proggie) { |
788 | close(0); /* won't need stdin */ | 788 | close(0); /* won't need stdin */ |
789 | option_mask32 &= ~OPT_o; /* -o with -e is meaningless! */ | 789 | option_mask32 &= ~OPT_o; /* -o with -e is meaningless! */ |