From owner-freebsd-current Sun Mar 31 0:25:45 2002 Delivered-To: freebsd-current@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id 668B137B400 for ; Sun, 31 Mar 2002 00:25:43 -0800 (PST) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.12.1/8.12.1) with ESMTP id g2V8Pf4t485992; Sun, 31 Mar 2002 03:25:41 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20020330224648.A93819@xor.obsecurity.org> References: <20020324173513.A75429@xor.obsecurity.org> <20020324.184313.30925676.imp@village.org> <20020324175436.A75804@xor.obsecurity.org> <20020330224648.A93819@xor.obsecurity.org> Date: Sun, 31 Mar 2002 03:25:41 -0500 To: Kris Kennaway From: Garance A Drosihn Subject: Re: stdout changes break some ports Cc: current@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: MIMEDefang 2.3 (www dot roaringpenguin dot com slash mimedefang) Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 10:46 PM -0800 3/30/02, Kris Kennaway wrote: >On Sun, Mar 24, 2002 at 05:54:36PM -0800, Kris Kennaway wrote: > > On Sun, Mar 24, 2002 at 06:43:13PM -0700, M. Warner Losh wrote: > > > No. This isn't something that is guaranteed to work per > > > the standards, iirc. The proper fix is to put the > > > initializer in main. > > >> OK. Someone needs to go and fix those 84 ports then. > >How does one fix this in a library? I've been moving the >initialization to main() for applications. If all else fails, have some global static variable, and check the value in the routine(s) which care. if the flag variable is still zero, then initialize the stdout variable and change the flag variable to 1. I imagine there's plenty of smarter ways to do it though. -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message