android: add a close-on-exec check on pipe()
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 6 Jun 2019 05:21:45 +0000 (05:21 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 6 Jun 2019 05:21:45 +0000 (05:21 +0000)
commit5b2a85d0ded21097885900889faa871fdb2e71b5
tree040307052a8a0d7a911cf74d7c617a32cfea801c
parent3da331b456214c51b1735d02d304df91930cd461
android: add a close-on-exec check on pipe()

On Android, pipe() is better to be replaced by pipe2() with O_CLOEXEC
flag to avoid file descriptor leakage.

Patch by Jian Cai!

Differential Revision: https://reviews.llvm.org/D61967

llvm-svn: 362673
clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp
clang-tools-extra/clang-tidy/android/CMakeLists.txt
clang-tools-extra/clang-tidy/android/CloexecPipeCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/android/CloexecPipeCheck.h [new file with mode: 0644]
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/android-cloexec-pipe.rst [new file with mode: 0644]
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/test/clang-tidy/android-cloexec-pipe.cpp [new file with mode: 0644]