diff options
-rw-r--r-- | usr.sbin/cdcontrol/cdcontrol.1 | 12 | ||||
-rw-r--r-- | usr.sbin/cdcontrol/cdcontrol.c | 20 |
2 files changed, 20 insertions, 12 deletions
diff --git a/usr.sbin/cdcontrol/cdcontrol.1 b/usr.sbin/cdcontrol/cdcontrol.1 index 71c4ebf..0b1022b 100644 --- a/usr.sbin/cdcontrol/cdcontrol.1 +++ b/usr.sbin/cdcontrol/cdcontrol.1 @@ -20,14 +20,7 @@ as or .Pa mcd0 . .Pp -If the device not specified, the environment variables -.Ev MUSIC_CD , -.Ev CD_DRIVE , -.Ev DISC -and -.Ev CDPLAY -will be used (in this order) to find the cd device. -.Pp + If no command is given, then .Nm enters an interactive mode, reading commands from the standard input. @@ -157,6 +150,9 @@ The following environment variables affect the execution of The cd device to use if one isn't specified with the .Fl f flag. +.It Ev CD_DRIVE Ev CDPLAY Ev DISC Ev MUSIC_CD +These variables have been deprecated in favour of +.Ev CDROM . .El .Sh FILES .Bl -tag -width /dev/mcd0c -compact diff --git a/usr.sbin/cdcontrol/cdcontrol.c b/usr.sbin/cdcontrol/cdcontrol.c index 7af8837..c22bad3 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:")) { |