Skip to content

Commit

Permalink
cdvdgigaherz:linux: Check ioctl return value
Browse files Browse the repository at this point in the history
Fixes Coverity CID 172718: Unchecked return value

Also avoid adding the sector leadout descriptor info to the TOC since it
actually isn't used.
  • Loading branch information
turtleli committed Nov 12, 2016
1 parent c5d727d commit f513ca2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions plugins/cdvdGigaherz/src/Unix/LinuxIOCtlSrc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,8 @@ bool IOCtlSrc::ReadCDInfo()

// TODO: Do I need a fallback if this doesn't work?
entry.cdte_track = 0xAA;
ioctl(m_device, CDROMREADTOCENTRY, &entry);
m_toc.push_back({static_cast<u32>(entry.cdte_addr.lba), entry.cdte_track,
entry.cdte_adr, entry.cdte_ctrl});
if (ioctl(m_device, CDROMREADTOCENTRY, &entry) == -1)
return false;

m_sectors = entry.cdte_addr.lba;
m_media_type = -1;
Expand Down

1 comment on commit f513ca2

@turtleli
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...I really mean track, not sector.

Please sign in to comment.