From 5e25ddb7d369b6785ec3aaa96cbc0521c22aeb0d Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Mon, 19 May 2008 09:48:17 +0000 Subject: - use STD*_FILENO some more. No object-code changes --- networking/nc_bloaty.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'networking/nc_bloaty.c') 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) /* if we have a timeout AND stdin is closed AND we haven't heard anything from the net during that time, assume it's dead and close it too. */ if (rr == 0) { - if (!FD_ISSET(0, &ding1)) + if (!FD_ISSET(STDIN_FILENO, &ding1)) netretry--; /* we actually try a coupla times. */ if (!netretry) { if (o_verbose > 1) /* normally we don't care */ @@ -597,12 +597,12 @@ Debug("got %d from the net, errno %d", rr, errno); goto shovel; /* okay, suck more stdin */ - if (FD_ISSET(0, &ding2)) { /* stdin: ding! */ - rr = read(0, bigbuf_in, BIGSIZ); + if (FD_ISSET(STDIN_FILENO, &ding2)) { /* stdin: ding! */ + rr = read(STDIN_FILENO, bigbuf_in, BIGSIZ); /* Considered making reads here smaller for UDP mode, but 8192-byte mobygrams are kinda fun and exercise the reassembler. */ if (rr <= 0) { /* at end, or fukt, or ... */ - FD_CLR(0, &ding1); /* disable and close stdin */ + FD_CLR(STDIN_FILENO, &ding1); /* disable and close stdin */ close(0); } else { rzleft = rr; @@ -625,7 +625,7 @@ Debug("got %d from the net, errno %d", rr, errno); return 1; } if (rnleft) { - rr = write(1, np, rnleft); + rr = write(STDOUT_FILENO, np, rnleft); if (rr > 0) { if (o_ofile) /* log the stdout */ oprint('<', (unsigned char *)np, rr); @@ -783,7 +783,7 @@ int nc_main(int argc, char **argv) } #endif - FD_SET(0, &ding1); /* stdin *is* initially open */ + FD_SET(STDIN_FILENO, &ding1); /* stdin *is* initially open */ if (proggie) { close(0); /* won't need stdin */ option_mask32 &= ~OPT_o; /* -o with -e is meaningless! */ -- cgit v1.2.3