summaryrefslogtreecommitdiffstats
path: root/minui
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-02-10 01:31:29 +0100
committerandroid-build-merger <android-build-merger@google.com>2017-02-10 01:31:29 +0100
commit70cbe1d2e766090e7aed2a62ea2f3a4f834e725e (patch)
treeff69df8bcd190d40c7a04268afd3e6b363d5443e /minui
parentMerge "minui: Clean up graphics_fbdev.cpp." am: 5121961421 am: e91a2d23ca am: c441edd1c3 (diff)
parentMerge "minui: Save errno before calling close()." am: df464dbe79 am: 8075089ca1 (diff)
downloadandroid_bootable_recovery-70cbe1d2e766090e7aed2a62ea2f3a4f834e725e.tar
android_bootable_recovery-70cbe1d2e766090e7aed2a62ea2f3a4f834e725e.tar.gz
android_bootable_recovery-70cbe1d2e766090e7aed2a62ea2f3a4f834e725e.tar.bz2
android_bootable_recovery-70cbe1d2e766090e7aed2a62ea2f3a4f834e725e.tar.lz
android_bootable_recovery-70cbe1d2e766090e7aed2a62ea2f3a4f834e725e.tar.xz
android_bootable_recovery-70cbe1d2e766090e7aed2a62ea2f3a4f834e725e.tar.zst
android_bootable_recovery-70cbe1d2e766090e7aed2a62ea2f3a4f834e725e.zip
Diffstat (limited to 'minui')
-rw-r--r--minui/graphics_adf.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/minui/graphics_adf.cpp b/minui/graphics_adf.cpp
index 17f30d1d4..9ab0b06bf 100644
--- a/minui/graphics_adf.cpp
+++ b/minui/graphics_adf.cpp
@@ -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;