cdvdgigaherz:linux: Check ioctl return value

Fixes Coverity CID 172718: Unchecked return value

Also avoid adding the sector leadout descriptor info to the TOC since it
actually isn't used.
This commit is contained in:
Jonathan Li 2016-11-12 23:18:42 +00:00
parent c5d727da39
commit f513ca2a28
1 changed files with 2 additions and 3 deletions

View File

@ -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;