bin/160979: 9.0 burncd error caused by change to cd0 from acd0
Jaakko Heinonen
jh at FreeBSD.org
Fri Sep 30 21:12:48 UTC 2011
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)
> @@ -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
More information about the freebsd-current
mailing list