From owner-freebsd-arch@FreeBSD.ORG Sat May 12 15:10:45 2007 Return-Path: X-Original-To: arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1C7F116A402; Sat, 12 May 2007 15:10:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id E212F13C45D; Sat, 12 May 2007 15:10:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 7BAE146F6D; Sat, 12 May 2007 11:10:44 -0400 (EDT) Date: Sat, 12 May 2007 16:10:44 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: "Sean C. Farley" In-Reply-To: <20070511182126.U9004@baba.farley.org> Message-ID: <20070512160859.T63806@fledge.watson.org> References: <20070504213312.GA33163@nagual.pp.ru> <20070504174657.D1343@thor.farley.org> <20070505213202.GA49925@nagual.pp.ru> <20070505163707.J6670@thor.farley.org> <20070505221125.GA50439@nagual.pp.ru> <20070506091835.A43775@besplex.bde.org> <20070508162458.G6015@baba.farley.org> <20070508222521.GA59534@nagual.pp.ru> <20070509200000.B56490@besplex.bde.org> <20070510184447.H4969@baba.farley.org> <20070511003443.GA6422@nagual.pp.ru> <20070511182126.U9004@baba.farley.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Daniel Eischen , arch@FreeBSD.org, Andrey Chernov Subject: Re: HEADS DOWN X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 May 2007 15:10:45 -0000 On Fri, 11 May 2007, Sean C. Farley wrote: > On Fri, 11 May 2007, Andrey Chernov wrote: > >> On Thu, May 10, 2007 at 06:58:45PM -0500, Sean C. Farley wrote: >>> Would there be any other changes anybody can see need to be made? What >>> type of testing would be desired? The regression tests I wrote provide >>> a good basic test. >> >> I worry about this sort of things errx(EXIT_FAILURE, "environ corrupt"); >> >> There is no mention anywhere that *env() functions can exit the program. >> Moreover some programs in theory can temprorarily put incorrect values into >> environment via putenv() after-modification or direct environ assignments >> for their own reasons. >> >> I suggest to change errx() to warnx()+return(failure). > > No need to worry any longer; I changed them into warnx(). What value should > I give errno? I do not want the program to receive a random error code. > The first warnx() could be EINVAL. The second warnx() would be a coding > error on my part. EDOOFUS would fit. :) I know I should not use it. > EINVAL? Actually, I'm not convinced that crashing the program isn't the right answer. If an application corrupts memory managed by libc or other libraries, crashing is generally considered an entirely acceptable failure mode. Robert N M Watson Computer Laboratory University of Cambridge