From 1ba4e981dbb75985b320c2d97c7c2567b9ebcf51 Mon Sep 17 00:00:00 2001 From: Jeff Vander Stoep Date: Fri, 21 Oct 2016 14:29:22 -0700 Subject: libion: open /dev/ion read-only /dev/ion driver does not recognize the write operation [1] so open it read-only. [1] http://lxr.free-electrons.com/source/drivers/staging/android/ion/ion.c?v=4.5#L1369 Test: Angler builds and boots Bug: 32120194 Change-Id: I9b26d43ea32cb24426404668701df1f1648d336c --- libion/ion.c | 2 +- libion/tests/device_test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'libion') diff --git a/libion/ion.c b/libion/ion.c index 4565efb80..2db88453e 100644 --- a/libion/ion.c +++ b/libion/ion.c @@ -34,7 +34,7 @@ int ion_open() { - int fd = open("/dev/ion", O_RDWR); + int fd = open("/dev/ion", O_RDONLY); if (fd < 0) ALOGE("open /dev/ion failed!\n"); return fd; diff --git a/libion/tests/device_test.cpp b/libion/tests/device_test.cpp index 0be52bf27..eb3f7b621 100644 --- a/libion/tests/device_test.cpp +++ b/libion/tests/device_test.cpp @@ -46,7 +46,7 @@ class Device : public IonAllHeapsTest { void Device::SetUp() { IonAllHeapsTest::SetUp(); - m_deviceFd = open("/dev/ion-test", O_RDWR); + m_deviceFd = open("/dev/ion-test", O_RDONLY); ASSERT_GE(m_deviceFd, 0); } -- cgit v1.2.3