From owner-cvs-src@FreeBSD.ORG Sat Jan 12 21:26:10 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 E89DB16A418; Sat, 12 Jan 2008 21:26:10 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from mp2.macomnet.net (mp2.macomnet.net [195.128.64.6]) by mx1.freebsd.org (Postfix) with ESMTP id 55D8313C4CC; Sat, 12 Jan 2008 21:26:10 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from localhost (localhost.int.ru [127.0.0.1] (may be forged)) by mp2.macomnet.net (8.13.7/8.13.8) with ESMTP id m0CKtP6k012976; Sat, 12 Jan 2008 23:55:25 +0300 (MSK) (envelope-from maxim@macomnet.ru) Date: Sat, 12 Jan 2008 23:55:25 +0300 (MSK) From: Maxim Konovalov To: David Schultz In-Reply-To: <20080112205254.GB3090@VARK.MIT.EDU> Message-ID: <20080112235350.C10888@mp2.macomnet.net> References: <200801122037.m0CKb6CS009262@repoman.freebsd.org> <20080112205254.GB3090@VARK.MIT.EDU> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: Sat, 12 Jan 2008 21:26:11 -0000 On Sat, 12 Jan 2008, 15:52-0500, David Schultz wrote: > On Sat, Jan 12, 2008, Maxim Konovalov wrote: > > - asprintf(&devname, "%s%d", > > + if (asprintf(&devname, "%s%d", > > cur.dinfo->devices[di].device_name, > > - cur.dinfo->devices[di].unit_number); > > + cur.dinfo->devices[di].unit_number) == 1) > > + errx(1, "asprintf() failed (out of memory?)"); > > err(1, "asprintf") will produce a more meaningful error message, > by the way. Also, I think you wanted to compare the return value > of asprintf to -1 instead of 1. > 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. -- Maxim Konovalov