android: add a close-on-exec check on pipe2()
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 6 Jun 2019 05:21:39 +0000 (05:21 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 6 Jun 2019 05:21:39 +0000 (05:21 +0000)
commit3da331b456214c51b1735d02d304df91930cd461
tree25f41650db39809fa3d7d360f96558b955d476b1
parent5e7ca755d8c75c92ff42874846885d37157e55eb
android: add a close-on-exec check on pipe2()

On Android, pipe2() is better to set O_CLOEXEC flag to avoid file
descriptor leakage.

Patch by Jian Cai!

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

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