Merge "libcutils: abort for invalid fd"

am: 76f99770d1

* commit '76f99770d12aedab21a9c2ecee82e5874db50bd1':
  libcutils: abort for invalid fd
This commit is contained in:
Mark Salyzyn 2016-02-05 18:12:07 +00:00 committed by android-build-merger
commit 8a0e1c51bd
1 changed files with 3 additions and 2 deletions

View File

@ -118,15 +118,16 @@ static int __ashmem_is_ashmem(int fd)
}
if (rdev) {
ALOGE("illegal fd=%d mode=0%o rdev=%d:%d expected 0%o %d:%d",
LOG_ALWAYS_FATAL("illegal fd=%d mode=0%o rdev=%d:%d expected 0%o %d:%d",
fd, st.st_mode, major(st.st_rdev), minor(st.st_rdev),
S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IRGRP,
major(rdev), minor(rdev));
} else {
ALOGE("illegal fd=%d mode=0%o rdev=%d:%d expected 0%o",
LOG_ALWAYS_FATAL("illegal fd=%d mode=0%o rdev=%d:%d expected 0%o",
fd, st.st_mode, major(st.st_rdev), minor(st.st_rdev),
S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IRGRP);
}
/* NOTREACHED */
errno = ENOTTY;
return -1;