Skip to content

Commit

Permalink
Fix bug in cdrom drive status handling
Browse files Browse the repository at this point in the history
The bare if evaluated to true for return codes > 0 and that's wrong (CDS_DISC_OK = 4).

Fixes #511.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
  • Loading branch information
JoeLametta committed Oct 12, 2020
1 parent d885e79 commit 04ff005
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion whipper/command/cd.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def do(self):
utils.load_device(self.device)
utils.unmount_device(self.device)
# Exit and inform the user if there's no CD in the disk drive
if drive.get_cdrom_drive_status(self.device): # rc == 1 means no disc
if drive.get_cdrom_drive_status(self.device) == 1: # rc 1 -> no disc
raise OSError("no CD detected, please insert one and retry")

# first, read the normal TOC, which is fast
Expand Down

0 comments on commit 04ff005

Please # to comment.