Merge "minui: Save errno before calling close()."
am: df464dbe79
Change-Id: I58e4df9b09b8c6e1470a815180df73d908b98d0a
This commit is contained in:
commit
8075089ca1
1 changed files with 2 additions and 1 deletions
|
@ -67,8 +67,9 @@ static int adf_surface_init(adf_pdata* pdata, drm_mode_modeinfo* mode, adf_surfa
|
|||
surf->base.data = static_cast<uint8_t*>(mmap(nullptr, surf->pitch * surf->base.height, PROT_WRITE,
|
||||
MAP_SHARED, surf->fd, surf->offset));
|
||||
if (surf->base.data == MAP_FAILED) {
|
||||
int saved_errno = errno;
|
||||
close(surf->fd);
|
||||
return -errno;
|
||||
return -saved_errno;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue