summaryrefslogtreecommitdiffstats
path: root/usr.bin/colcrt
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-07-15 06:57:36 +0000
committertjr <tjr@FreeBSD.org>2004-07-15 06:57:36 +0000
commit4d0f3815933091219a3e991d81ce163580546dec (patch)
tree37a3ecb066975dc533b2907f6f0cb03dcf23353a /usr.bin/colcrt
parent7b1443b6d70a2ea5a1cf2e1c22e82e15a6a12b00 (diff)
downloadFreeBSD-src-4d0f3815933091219a3e991d81ce163580546dec.zip
FreeBSD-src-4d0f3815933091219a3e991d81ce163580546dec.tar.gz
Use freopen() instead of a nasty hack.
Diffstat (limited to 'usr.bin/colcrt')
-rw-r--r--usr.bin/colcrt/colcrt.c3
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]);
}
OpenPOWER on IntegriCloud