From 5a516440e404b668e0505a1ceeb27e95c89942e1 Mon Sep 17 00:00:00 2001 From: joe Date: Sun, 8 Apr 2001 21:35:17 +0000 Subject: Don't complain about deprecated environment variables, like MUSIC_CD, being present in the environment if the user has CDROM defined, or has specified a device on the command line. This avoids users of ports like 'workman' that use these variables getting gratuitous warnings from cdcontrol. Suggested by: John Sellens --- usr.sbin/cdcontrol/cdcontrol.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'usr.sbin/cdcontrol') diff --git a/usr.sbin/cdcontrol/cdcontrol.c b/usr.sbin/cdcontrol/cdcontrol.c index c22bad3..94ae357 100644 --- a/usr.sbin/cdcontrol/cdcontrol.c +++ b/usr.sbin/cdcontrol/cdcontrol.c @@ -176,14 +176,6 @@ int main (int argc, char **argv) int cmd; char *arg; - cdname = use_cdrom_instead("MUSIC_CD"); - if (! cdname) - cdname = use_cdrom_instead("CD_DRIVE"); - if (! cdname) - cdname = use_cdrom_instead("DISC"); - if (! cdname) - cdname = use_cdrom_instead("CDPLAY"); - for (;;) { switch (getopt (argc, argv, "svhf:")) { case EOF: @@ -213,6 +205,15 @@ int main (int argc, char **argv) cdname = getenv("CDROM"); } + if (! cdname) + cdname = use_cdrom_instead("MUSIC_CD"); + if (! cdname) + cdname = use_cdrom_instead("CD_DRIVE"); + if (! cdname) + cdname = use_cdrom_instead("DISC"); + if (! cdname) + cdname = use_cdrom_instead("CDPLAY"); + if (! cdname) { cdname = DEFAULT_CD_DRIVE; warnx("no CD device name specified, defaulting to %s", cdname); -- cgit v1.1