diff options
Diffstat (limited to 'libs/binder/IShellCallback.cpp')
-rw-r--r-- | libs/binder/IShellCallback.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/binder/IShellCallback.cpp b/libs/binder/IShellCallback.cpp index 8b973019ee..c793df3266 100644 --- a/libs/binder/IShellCallback.cpp +++ b/libs/binder/IShellCallback.cpp @@ -16,6 +16,9 @@ #define LOG_TAG "ShellCallback" +#include <unistd.h> +#include <fcntl.h> + #include <binder/IShellCallback.h> #include <utils/Log.h> @@ -44,7 +47,7 @@ public: remote()->transact(OP_OPEN_OUTPUT_FILE, data, &reply, 0); reply.readExceptionCode(); int fd = reply.readParcelFileDescriptor(); - return fd >= 0 ? dup(fd) : fd; + return fd >= 0 ? fcntl(fd, F_DUPFD_CLOEXEC, 0) : fd; } }; |