commit | df464dbe79202b62f8b2cf73f45e52d9f32e5e5e | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Thu Feb 09 23:17:57 2017 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Thu Feb 09 23:17:59 2017 +0000 |
tree | b2380e8f70e86581af453c9500a028d846d8bfd3 | |
parent | 5121961421b801fd89b82188be6bb20462119c08 [diff] | |
parent | f04592ba230139d5132ebd8bb8610f6a98836882 [diff] |
Merge "minui: Save errno before calling close()."
diff --git a/minui/graphics_adf.cpp b/minui/graphics_adf.cpp index 17f30d1..9ab0b06 100644 --- a/minui/graphics_adf.cpp +++ b/minui/graphics_adf.cpp
@@ -67,8 +67,9 @@ 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;