Fix bug in cdrom drive status handling

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>
This commit is contained in:
JoeLametta
2020-10-12 12:20:53 +00:00
parent d885e79c9f
commit 04ff005806

View File

@@ -96,7 +96,7 @@ class _CD(BaseCommand):
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