diff options
author | tjr <tjr@FreeBSD.org> | 2004-07-15 06:57:36 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2004-07-15 06:57:36 +0000 |
commit | 4d0f3815933091219a3e991d81ce163580546dec (patch) | |
tree | 37a3ecb066975dc533b2907f6f0cb03dcf23353a | |
parent | 7b1443b6d70a2ea5a1cf2e1c22e82e15a6a12b00 (diff) | |
download | FreeBSD-src-4d0f3815933091219a3e991d81ce163580546dec.zip FreeBSD-src-4d0f3815933091219a3e991d81ce163580546dec.tar.gz |
Use freopen() instead of a nasty hack.
-rw-r--r-- | usr.bin/colcrt/colcrt.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/usr.bin/colcrt/colcrt.c b/usr.bin/colcrt/colcrt.c index 5d7fd15..2f0bce3 100644 --- a/usr.bin/colcrt/colcrt.c +++ b/usr.bin/colcrt/colcrt.c @@ -103,8 +103,7 @@ main(int argc, char *argv[]) do { if (argc > 0) { - close(0); - if (!(f = fopen(argv[0], "r"))) { + if (!(f = freopen(argv[0], "r", stdin))) { fflush(stdout); err(1, "%s", argv[0]); } |