summaryrefslogtreecommitdiff
path: root/libcutils/ashmem_test.cpp
diff options
context:
space:
mode:
authorJustin DeMartino <jjdemartino@google.com>2020-10-14 19:39:53 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-10-14 19:39:53 +0000
commit0d11af03e43f110b0bb160f7e20436d0043e3038 (patch)
tree48f8bcca856276ec73a86dd3fb26143d3ca64578 /libcutils/ashmem_test.cpp
parent075666ebd0dee8d0c4a2efa54f7c324a3f67ee2a (diff)
parenta6c01e4e98d2b343dcecfc99611e2e6250c730db (diff)
Merge changes from topic "SP1A.200921.001" into s-keystone-qcom-dev
* changes: fs_mgr: adb-remount-test.sh: filter out more administrivia mounts. Merge SP1A.200921.001 Change-Id: I90b97c4e9fb10b1f45e74def404823eed5b1aaa8
Diffstat (limited to 'libcutils/ashmem_test.cpp')
-rw-r--r--libcutils/ashmem_test.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libcutils/ashmem_test.cpp b/libcutils/ashmem_test.cpp
index b37d020fb..fb657f6e6 100644
--- a/libcutils/ashmem_test.cpp
+++ b/libcutils/ashmem_test.cpp
@@ -35,6 +35,11 @@ void TestCreateRegion(size_t size, unique_fd &fd, int prot) {
ASSERT_TRUE(ashmem_valid(fd));
ASSERT_EQ(size, static_cast<size_t>(ashmem_get_size_region(fd)));
ASSERT_EQ(0, ashmem_set_prot_region(fd, prot));
+
+ // We've been inconsistent historically about whether or not these file
+ // descriptors were CLOEXEC. Make sure we're consistent going forward.
+ // https://issuetracker.google.com/165667331
+ ASSERT_EQ(FD_CLOEXEC, (fcntl(fd, F_GETFD) & FD_CLOEXEC));
}
void TestMmap(const unique_fd& fd, size_t size, int prot, void** region, off_t off = 0) {