From owner-cvs-all Mon Jul 23 5: 4:56 2001 Delivered-To: cvs-all@freebsd.org Received: from assaris.sics.se (assaris.sics.se [193.10.66.234]) by hub.freebsd.org (Postfix) with ESMTP id 26F1737B405; Mon, 23 Jul 2001 05:04:52 -0700 (PDT) (envelope-from assar@assaris.sics.se) Received: (from assar@localhost) by assaris.sics.se (8.9.3/8.9.3) id OAA38658; Mon, 23 Jul 2001 14:04:49 +0200 (CEST) (envelope-from assar) To: Alfred Perlstein Cc: Brian Somers , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libutil ecalloc.c emalloc.3 emalloc.c erealloc.c estrdup.c Makefile libutil.h References: <200107230223.f6N2Nfg14201@hak.lan.Awfulhak.org> <20010722223812.L49508@sneakerz.org> <5lr8v88d1m.fsf@assaris.sics.se> <20010723010902.M49508@sneakerz.org> From: Assar Westerlund Date: 23 Jul 2001 14:04:47 +0200 In-Reply-To: Alfred Perlstein's message of "Mon, 23 Jul 2001 01:09:03 -0500" Message-ID: <5ln15vx34w.fsf@assaris.sics.se> Lines: 18 User-Agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.6 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Alfred Perlstein writes: > > `Only use these functions when the only action on failure is to exit > > the program' ? > > s/exit/when there is no state that might need recovering from/ Yeah, I was trying to say both that there is no cleanup needed and exiting is the right error handling. > Basically, any subroutines that may fail for one reason or another > _and_ use these functions become cancellation points, meaning they > are unsafe to call if there is any in progress transactions that > may need cleanup. It taints code. :( Yes. You should not do this (independently if it's as code or a function call) in a library. /assar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message