diff options
| author | 2022-03-30 20:02:57 +0000 | |
|---|---|---|
| committer | 2022-03-30 20:02:57 +0000 | |
| commit | bab1e600e393344ab05e7aee51a6909b543ea203 (patch) | |
| tree | f9a2a86b14ec9fa599d17a420e94e641e7fb2254 | |
| parent | 306ae2738a24bedf3827cc6b5d6d4c0cd05443ff (diff) | |
| parent | b8ba6e9cc036c9face3ab1c738fdc51cfd499323 (diff) | |
Merge "dumpstate: Close API FDs on exec" am: b8ba6e9cc0
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2043435
Change-Id: Iaa7b6bf1a545a50f7993efe010ba1ba5afd57124
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | cmds/dumpstate/dumpstate.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp index 24b201f8ab..890c15f895 100644 --- a/cmds/dumpstate/dumpstate.cpp +++ b/cmds/dumpstate/dumpstate.cpp @@ -2733,8 +2733,8 @@ void Dumpstate::DumpOptions::Initialize(BugreportMode bugreport_mode, const android::base::unique_fd& screenshot_fd_in, bool is_screenshot_requested) { // Duplicate the fds because the passed in fds don't outlive the binder transaction. - bugreport_fd.reset(dup(bugreport_fd_in.get())); - screenshot_fd.reset(dup(screenshot_fd_in.get())); + bugreport_fd.reset(fcntl(bugreport_fd_in.get(), F_DUPFD_CLOEXEC, 0)); + screenshot_fd.reset(fcntl(screenshot_fd_in.get(), F_DUPFD_CLOEXEC, 0)); SetOptionsFromMode(bugreport_mode, this, is_screenshot_requested); } |