diff options
author | joe <joe@FreeBSD.org> | 2001-04-08 21:35:17 +0000 |
---|---|---|
committer | joe <joe@FreeBSD.org> | 2001-04-08 21:35:17 +0000 |
commit | 5a516440e404b668e0505a1ceeb27e95c89942e1 (patch) | |
tree | 235c1e4b8014098c55c1a341a1af1127061df1f6 /usr.sbin/cdcontrol | |
parent | ab4549c73c054a888dca8fee10c7c62f57993d3f (diff) | |
download | FreeBSD-src-5a516440e404b668e0505a1ceeb27e95c89942e1.zip FreeBSD-src-5a516440e404b668e0505a1ceeb27e95c89942e1.tar.gz |
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 <jsellens@generalconcepts.com>
Diffstat (limited to 'usr.sbin/cdcontrol')
-rw-r--r-- | usr.sbin/cdcontrol/cdcontrol.c | 17 |
1 files changed, 9 insertions, 8 deletions
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); |