Merge "libcutils: fallback to /dev/ashmem" am: 6e016ef80e
am: 0714a9eae2
Change-Id: I18000e3aed6ee3b5f5a2bbf0975f12ca85400a72
This commit is contained in:
commit
315d44f02c
1 changed files with 8 additions and 4 deletions
|
@ -203,19 +203,23 @@ static int __ashmem_open_locked()
|
|||
{
|
||||
static const std::string ashmem_device_path = get_ashmem_device_path();
|
||||
|
||||
int ret;
|
||||
struct stat st;
|
||||
|
||||
if (ashmem_device_path.empty()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int fd = TEMP_FAILURE_RETRY(open(ashmem_device_path.c_str(), O_RDWR | O_CLOEXEC));
|
||||
|
||||
// fallback for APEX w/ use_vendor on Q, which would have still used /dev/ashmem
|
||||
if (fd < 0) {
|
||||
fd = TEMP_FAILURE_RETRY(open("/dev/ashmem", O_RDWR | O_CLOEXEC));
|
||||
}
|
||||
|
||||
if (fd < 0) {
|
||||
return fd;
|
||||
}
|
||||
|
||||
ret = TEMP_FAILURE_RETRY(fstat(fd, &st));
|
||||
struct stat st;
|
||||
int ret = TEMP_FAILURE_RETRY(fstat(fd, &st));
|
||||
if (ret < 0) {
|
||||
int save_errno = errno;
|
||||
close(fd);
|
||||
|
|
Loading…
Reference in a new issue