mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-18 10:43:58 +00:00
[common] ivshmem: fix failure to check ioctl for error result
This commit is contained in:
parent
a3b51220ed
commit
9a53880b9b
1 changed files with 7 additions and 1 deletions
|
@ -119,7 +119,7 @@ bool ivshmemOpenDev(struct IVSHMEM * dev, const char * shmDevice)
|
||||||
{
|
{
|
||||||
DEBUG_ASSERT(dev);
|
DEBUG_ASSERT(dev);
|
||||||
|
|
||||||
unsigned int devSize;
|
int devSize;
|
||||||
int devFd;
|
int devFd;
|
||||||
bool hasDMA;
|
bool hasDMA;
|
||||||
|
|
||||||
|
@ -139,6 +139,12 @@ bool ivshmemOpenDev(struct IVSHMEM * dev, const char * shmDevice)
|
||||||
|
|
||||||
// get the device size
|
// get the device size
|
||||||
devSize = ioctl(devFd, KVMFR_DMABUF_GETSIZE, 0);
|
devSize = ioctl(devFd, KVMFR_DMABUF_GETSIZE, 0);
|
||||||
|
if (devSize < 0)
|
||||||
|
{
|
||||||
|
DEBUG_ERROR("Failed to get the device size");
|
||||||
|
close(devFd);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
hasDMA = true;
|
hasDMA = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue