From owner-freebsd-hackers Thu May 2 07:11:43 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id HAA28096 for hackers-outgoing; Thu, 2 May 1996 07:11:43 -0700 (PDT) Received: from tfs.com (tfs.com [140.145.250.1]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id HAA28090 for ; Thu, 2 May 1996 07:11:39 -0700 (PDT) Received: from critter.tfs.com by tfs.com (smail3.1.28.1) with SMTP id m0uEz6W-0003vmC; Thu, 2 May 96 07:11 PDT Received: from localhost (localhost [127.0.0.1]) by critter.tfs.com (8.7.5/8.6.12) with SMTP id OAA03261; Thu, 2 May 1996 14:11:36 GMT X-Authentication-Warning: critter.tfs.com: Host localhost [127.0.0.1] didn't use HELO protocol To: Josh MacDonald cc: freebsd-hackers@freebsd.org Subject: Re: stdio problem In-reply-to: Your message of "Thu, 02 May 1996 01:58:26 MST." <199605020858.BAA05189@deceit.xcf.berkeley.edu> Date: Thu, 02 May 1996 14:11:36 +0000 Message-ID: <3259.831046296@critter.tfs.com> From: Poul-Henning Kamp Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > close(0); > if(!freopen(argv[1], "r", stdin)) { doing a "close(0)" is bound to confuse the stdio library. don't do that. freopen will close the filedesriptor and thud DTRT. -- Poul-Henning Kamp | phk@FreeBSD.ORG FreeBSD Core-team. http://www.freebsd.org/~phk | phk@login.dknet.dk Private mailbox. whois: [PHK] | phk@ref.tfs.com TRW Financial Systems, Inc. Future will arrive by its own means, progress not so.