mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Move speed units conversion to right before it is used. This catches the
case when the -s option is not used.
This commit is contained in:
parent
eb87c5a73a
commit
cfe6d7e913
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=106052
@ -119,7 +119,7 @@ main(int argc, char **argv)
|
||||
if (strcasecmp("max", optarg) == 0)
|
||||
speed = CDR_MAX_SPEED;
|
||||
else
|
||||
speed = atoi(optarg) * 177;
|
||||
speed = atoi(optarg);
|
||||
if (speed <= 0)
|
||||
errx(EX_USAGE, "Invalid speed: %s", optarg);
|
||||
break;
|
||||
@ -148,6 +148,7 @@ main(int argc, char **argv)
|
||||
if (ioctl(fd, CDRIOCGETBLOCKSIZE, &saved_block_size) < 0)
|
||||
err(EX_IOERR, "ioctl(CDRIOCGETBLOCKSIZE)");
|
||||
|
||||
speed *= 177;
|
||||
if (ioctl(fd, CDRIOCWRITESPEED, &speed) < 0)
|
||||
err(EX_IOERR, "ioctl(CDRIOCWRITESPEED)");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user