diff options
| author | Nate Lawson <njl@FreeBSD.org> | 2002-10-18 22:03:39 +0000 |
|---|---|---|
| committer | Nate Lawson <njl@FreeBSD.org> | 2002-10-18 22:03:39 +0000 |
| commit | 76ba4ecdad596812b20ae4c2ff13645605831905 (patch) | |
| tree | 540c29f87f9954dc980102ee2621565072883c36 /usr.sbin/cdcontrol | |
| parent | eb5b0bc42e2bd9517ce418b62a95f540f6625dce (diff) | |
Notes
Diffstat (limited to 'usr.sbin/cdcontrol')
| -rw-r--r-- | usr.sbin/cdcontrol/cdcontrol.1 | 6 | ||||
| -rw-r--r-- | usr.sbin/cdcontrol/cdcontrol.c | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/cdcontrol/cdcontrol.1 b/usr.sbin/cdcontrol/cdcontrol.1 index 3f986fe4e6e7..94214f944844 100644 --- a/usr.sbin/cdcontrol/cdcontrol.1 +++ b/usr.sbin/cdcontrol/cdcontrol.1 @@ -164,9 +164,9 @@ Set minute-second-frame ioctl mode (default). .It Ic set Cm lba Set LBA ioctl mode. .It Ic speed Ar s -Set the highest speed that the drive should use. -The speed is a multiple of the single speed. -This command is currently only supported on ATAPI drives. +Set the highest speed that the drive should use for reading data. +The units are multiples of a single speed CDROM (150 KB/s). +Specify "max" to use the drive's fastest speed. .It Ic quit Quit the program. .El diff --git a/usr.sbin/cdcontrol/cdcontrol.c b/usr.sbin/cdcontrol/cdcontrol.c index f497c5240aa2..5dd058599b73 100644 --- a/usr.sbin/cdcontrol/cdcontrol.c +++ b/usr.sbin/cdcontrol/cdcontrol.c @@ -282,7 +282,6 @@ int run (int cmd, char *arg) { long speed; int l, r, rc; - char *ep; switch (cmd) { @@ -435,9 +434,11 @@ int run (int cmd, char *arg) return (0); errno = 0; - speed = strtol(arg, &ep, 10); - if (*ep || ep == arg || speed <= 0 || speed > INT_MAX || - errno != 0) { + if (strcasecmp("max", arg) == 0) + speed = CDR_MAX_SPEED; + else + speed = strtol(arg, NULL, 10) * 177; + if (speed <= 0 || speed > INT_MAX) { warnx("invalid command arguments %s", arg); return (0); } |
