Re: bin/160979: 9.0 burncd error caused by change to cd0 from acd0

From: Jaakko Heinonen <jh_at_FreeBSD.org>
Date: Sat, 1 Oct 2011 00:12:44 +0300
On 2011-09-29, Craig Rodrigues wrote:
> On Wed, Sep 28, 2011 at 1:15 AM, Jaakko Heinonen <jh_at_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)
> _at__at_ -82,6 +82,15 _at__at_
>  	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
Received on Fri Sep 30 2011 - 19:12:48 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:18 UTC