diff options
author | Josef Karthauser <joe@FreeBSD.org> | 2001-01-16 20:31:53 +0000 |
---|---|---|
committer | Josef Karthauser <joe@FreeBSD.org> | 2001-01-16 20:31:53 +0000 |
commit | bb44f0089b0ec7a2e9109f9d299ab52a39c78f86 (patch) | |
tree | 2987b2697a87d159ab1b57c0ef56d62bc1be104b /usr.sbin/cdcontrol/cdcontrol.c | |
parent | ffefd50ada13360d714ee464644f4fe8a725b24a (diff) | |
download | src-bb44f0089b0ec7a2e9109f9d299ab52a39c78f86.tar.gz src-bb44f0089b0ec7a2e9109f9d299ab52a39c78f86.zip |
Deprecate the use of the CD_DRIVE, CDPLAY, DISC and MUSIC_CD environment
variables in favour of CDROM.
Discussed on: stable@FreeBSD.org
Notes
Notes:
svn path=/head/; revision=71122
Diffstat (limited to 'usr.sbin/cdcontrol/cdcontrol.c')
-rw-r--r-- | usr.sbin/cdcontrol/cdcontrol.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/usr.sbin/cdcontrol/cdcontrol.c b/usr.sbin/cdcontrol/cdcontrol.c index 7af88374e04c..c22bad333dd7 100644 --- a/usr.sbin/cdcontrol/cdcontrol.c +++ b/usr.sbin/cdcontrol/cdcontrol.c @@ -159,18 +159,30 @@ void usage () exit (1); } +char *use_cdrom_instead(char *old_envvar) +{ + char *device; + + device = getenv(old_envvar); + if (device) + warnx("%s environment variable deprecated, " + "please use CDROM in the future.", old_envvar); + return device; +} + + int main (int argc, char **argv) { int cmd; char *arg; - cdname = getenv ("MUSIC_CD"); + cdname = use_cdrom_instead("MUSIC_CD"); if (! cdname) - cdname = getenv ("CD_DRIVE"); + cdname = use_cdrom_instead("CD_DRIVE"); if (! cdname) - cdname = getenv ("DISC"); + cdname = use_cdrom_instead("DISC"); if (! cdname) - cdname = getenv ("CDPLAY"); + cdname = use_cdrom_instead("CDPLAY"); for (;;) { switch (getopt (argc, argv, "svhf:")) { |