From owner-cvs-src@FreeBSD.ORG Sat Jan 12 20:52:57 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 7EC8016A421; Sat, 12 Jan 2008 20:52:57 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.freebsd.org (Postfix) with ESMTP id 1C95C13C4D9; Sat, 12 Jan 2008 20:52:56 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.14.2/8.14.1) with ESMTP id m0CKqsln003272; Sat, 12 Jan 2008 15:52:54 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.14.2/8.14.1/Submit) id m0CKqsCk003271; Sat, 12 Jan 2008 15:52:54 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Sat, 12 Jan 2008 15:52:54 -0500 From: David Schultz To: Maxim Konovalov Message-ID: <20080112205254.GB3090@VARK.MIT.EDU> Mail-Followup-To: Maxim Konovalov , src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG References: <200801122037.m0CKb6CS009262@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200801122037.m0CKb6CS009262@repoman.freebsd.org> 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 20:52:57 -0000 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.