diff options
author | Tao Bao <tbao@google.com> | 2019-03-02 01:22:07 +0100 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-03-02 01:22:07 +0100 |
commit | 23cbb9a7de416f6e21675d4cc95619ca872da82f (patch) | |
tree | 8824f5cd4467003dd91191b087eda990d0af04fd | |
parent | Merge "Use android::base::Pipe." am: 21cfc8b6f4 am: a04a7d89c2 (diff) | |
parent | Merge "Use O_CLOEXEC at a few places." am: e3857ca43e (diff) | |
download | android_bootable_recovery-23cbb9a7de416f6e21675d4cc95619ca872da82f.tar android_bootable_recovery-23cbb9a7de416f6e21675d4cc95619ca872da82f.tar.gz android_bootable_recovery-23cbb9a7de416f6e21675d4cc95619ca872da82f.tar.bz2 android_bootable_recovery-23cbb9a7de416f6e21675d4cc95619ca872da82f.tar.lz android_bootable_recovery-23cbb9a7de416f6e21675d4cc95619ca872da82f.tar.xz android_bootable_recovery-23cbb9a7de416f6e21675d4cc95619ca872da82f.tar.zst android_bootable_recovery-23cbb9a7de416f6e21675d4cc95619ca872da82f.zip |
-rw-r--r-- | minui/events.cpp | 2 | ||||
-rw-r--r-- | minui/graphics_adf.cpp | 2 | ||||
-rw-r--r-- | minui/graphics_drm.cpp | 2 | ||||
-rw-r--r-- | minui/graphics_fbdev.cpp | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/minui/events.cpp b/minui/events.cpp index d94e97723..30f8d50a2 100644 --- a/minui/events.cpp +++ b/minui/events.cpp @@ -66,7 +66,7 @@ int ev_init(ev_callback input_cb, bool allow_touch_inputs) { dirent* de; while ((de = readdir(dir))) { if (strncmp(de->d_name, "event", 5)) continue; - int fd = openat(dirfd(dir), de->d_name, O_RDONLY); + int fd = openat(dirfd(dir), de->d_name, O_RDONLY | O_CLOEXEC); if (fd == -1) continue; // Use unsigned long to match ioctl's parameter type. diff --git a/minui/graphics_adf.cpp b/minui/graphics_adf.cpp index 9eea497d6..10cd60709 100644 --- a/minui/graphics_adf.cpp +++ b/minui/graphics_adf.cpp @@ -101,7 +101,7 @@ int MinuiBackendAdf::DeviceInit(adf_device* dev) { err = adf_device_attach(dev, eng_id, intf_id); if (err < 0 && err != -EALREADY) return err; - intf_fd = adf_interface_open(dev, intf_id, O_RDWR); + intf_fd = adf_interface_open(dev, intf_id, O_RDWR | O_CLOEXEC); if (intf_fd < 0) return intf_fd; err = InterfaceInit(); diff --git a/minui/graphics_drm.cpp b/minui/graphics_drm.cpp index 765e2625a..7b2eed15d 100644 --- a/minui/graphics_drm.cpp +++ b/minui/graphics_drm.cpp @@ -285,7 +285,7 @@ GRSurface* MinuiBackendDrm::Init() { /* Consider DRM devices in order. */ for (int i = 0; i < DRM_MAX_MINOR; i++) { auto dev_name = android::base::StringPrintf(DRM_DEV_NAME, DRM_DIR_NAME, i); - android::base::unique_fd fd(open(dev_name.c_str(), O_RDWR)); + android::base::unique_fd fd(open(dev_name.c_str(), O_RDWR | O_CLOEXEC)); if (fd == -1) continue; /* We need dumb buffers. */ diff --git a/minui/graphics_fbdev.cpp b/minui/graphics_fbdev.cpp index 8d9c9741d..2584017d6 100644 --- a/minui/graphics_fbdev.cpp +++ b/minui/graphics_fbdev.cpp @@ -56,7 +56,7 @@ void MinuiBackendFbdev::SetDisplayedFramebuffer(size_t n) { } GRSurface* MinuiBackendFbdev::Init() { - android::base::unique_fd fd(open("/dev/graphics/fb0", O_RDWR)); + android::base::unique_fd fd(open("/dev/graphics/fb0", O_RDWR | O_CLOEXEC)); if (fd == -1) { perror("cannot open fb0"); return nullptr; |