From owner-cvs-src@FreeBSD.ORG Sun Jan 13 13:57:59 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66BD216A41B; Sun, 13 Jan 2008 13:57:59 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 3126213C44B; Sun, 13 Jan 2008 13:57:58 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 1C517207E; Sun, 13 Jan 2008 14:57:50 +0100 (CET) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: -0.2/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on tim.des.no Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 8644B2049; Sun, 13 Jan 2008 14:57:49 +0100 (CET) Received: by ds4.des.no (Postfix, from userid 1001) id 5712B844C0; Sun, 13 Jan 2008 14:57:49 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Maxim Konovalov References: <200801122037.m0CKb6CS009262@repoman.freebsd.org> <20080112205254.GB3090@VARK.MIT.EDU> <20080112235350.C10888@mp2.macomnet.net> <20080112211919.GA3408@VARK.MIT.EDU> Date: Sun, 13 Jan 2008 14:57:49 +0100 In-Reply-To: <20080112211919.GA3408@VARK.MIT.EDU> (David Schultz's message of "Sat\, 12 Jan 2008 16\:19\:19 -0500") Message-ID: <86ve5xq142.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: cvs-src@FreeBSD.ORG, src-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/usr.sbin/iostat iostat.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jan 2008 13:57:59 -0000 David Schultz writes: > Maxim Konovalov writes: > > err(1, "asprintf") was my first version, yes. But I failed to find in > > the man page it sets errno. Thanks for the review, I'll fix the typo > > shortly. > I don't think it always does set errno, but you can set errno to 0 > before the call, and you'll get either the real error message from > err() or "unknown error". If asprintf() fails because malloc() failed, malloc() will have set errno to ENOMEM. I can't think of any other failure mode for asprintf() that won't either be silently ignored (error in format string) or result in a segmentation fault (bogus argument to %s). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no