Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Oct 2011 00:12:44 +0300
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        Craig Rodrigues <rodrigc@crodrigues.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: bin/160979: 9.0 burncd error caused by change to cd0 from acd0
Message-ID:  <20110930211243.GA2139@jh>
In-Reply-To: <CAG=rPVcLUqs14VfxKffDBWCoBG7u=C5dV45n3ameRXzu5rqHvQ@mail.gmail.com>
References:  <CAG=rPVeAPt0_=jNXaHcnB8QCtYuvi5z69MDMFEgyD0HBQT0Mcw@mail.gmail.com> <4E812DB7.3000302@FreeBSD.org> <CAG=rPVcTHiPLFG1%2BdZmi1OWpyZsw=Px=PJT55UFGN_mxt3y%2BJw@mail.gmail.com> <alpine.BSF.2.00.1109262027460.81576@toaster.local> <CAG=rPVeYjqZJuEzVG_kf%2B29bZx%2BZ%2B7du6DsoFou92WDx78B5Dg@mail.gmail.com> <alpine.BSF.2.00.1109262106390.81576@toaster.local> <CAJ-VmokTFaG09=3S8Fw1RwYDJ-Q2OXd0rox6e5AW1DBR4W1AjA@mail.gmail.com> <CAG=rPVdhqhjPEwHGhHBoOYB6rTX=UD2%2B-ehK8-6oT93M5Ec5Tg@mail.gmail.com> <20110928081514.GA5077@jh> <CAG=rPVcLUqs14VfxKffDBWCoBG7u=C5dV45n3ameRXzu5rqHvQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2011-09-29, Craig Rodrigues wrote:
> On Wed, Sep 28, 2011 at 1:15 AM, Jaakko Heinonen <jh@freebsd.org> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110930211243.GA2139>