From owner-freebsd-current@FreeBSD.ORG Fri Sep 30 21:12:48 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C0361065679 for ; Fri, 30 Sep 2011 21:12:48 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by mx1.freebsd.org (Postfix) with ESMTP id 2B6D48FC0C for ; Fri, 30 Sep 2011 21:12:47 +0000 (UTC) Received: from jh (a91-153-115-208.elisa-laajakaista.fi [91.153.115.208]) by gw02.mail.saunalahti.fi (Postfix) with SMTP id 5C21B13959F; Sat, 1 Oct 2011 00:12:44 +0300 (EEST) Date: Sat, 1 Oct 2011 00:12:44 +0300 From: Jaakko Heinonen To: Craig Rodrigues Message-ID: <20110930211243.GA2139@jh> References: <4E812DB7.3000302@FreeBSD.org> <20110928081514.GA5077@jh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@freebsd.org Subject: Re: bin/160979: 9.0 burncd error caused by change to cd0 from acd0 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2011 21:12:48 -0000 On 2011-09-29, Craig Rodrigues wrote: > On Wed, Sep 28, 2011 at 1:15 AM, Jaakko Heinonen wrote: > > I think that using the FEATURE() macro and feature_present(3) might be > > more appropriate for this. > > Oh, OK. I was unfamiliar with these API's because they are new in FreeBSD 8. :) > How about the attached patch? Looks mostly OK to me. > Index: usr.sbin/burncd/burncd.c > =================================================================== > --- usr.sbin/burncd/burncd.c (revision 225368) > +++ usr.sbin/burncd/burncd.c (working copy) > @@ -82,6 +82,15 @@ > int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0; > const char *dev, *env_speed; > > + if (feature_present("ata_cam")) { > + printf("\nATA_CAM option is enabled in kernel.\n" > + "Install the sysutils/cdrtools port and use cdrecord " > + "instead.\n\n" > + "Please refer to:\n" > + "http://www.freebsd.org/doc/handbook/creating-cds.html#CDRECORD\n"); > + exit(1); > + } > + Why do you use printf() + exit() here and errx() in atacontrol? Is there reason to not use errx() also here? > + if (feature_present("ata_cam")) { > + errx(1, "ATA_CAM option is enabled in kernel.\n" > + "Please use camcontrol instead.\n"); > + } errx(3) adds a newline character to the output. Thus the latter '\n' is redundant. burncd(8) manual page date should be bumped. Thanks. -- Jaakko