diff options
author | Yan Wang <yawanng@google.com> | 2017-07-12 17:43:36 +0000 |
---|---|---|
committer | Yan Wang <yawanng@google.com> | 2017-07-12 17:43:36 +0000 |
commit | b38045d02ebd412f32955769feaa6ba62f3ffd4d (patch) | |
tree | ea63c6589177cb53314d1a44aee21094cd60d889 /clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp | |
parent | 4fc696635ded88843f235e55b29c3eefc7c4810a (diff) | |
download | bcm5719-llvm-b38045d02ebd412f32955769feaa6ba62f3ffd4d.tar.gz bcm5719-llvm-b38045d02ebd412f32955769feaa6ba62f3ffd4d.zip |
[clang-tidy] Add a new Android check "android-cloexec-socket"
Summary: socket() is better to include SOCK_CLOEXEC in its type argument to avoid the file descriptor leakage.
Reviewers: chh, Eugene.Zelenko, alexfh, hokein, aaron.ballman
Reviewed By: chh, alexfh
Subscribers: srhines, mgorny, JDevlieghere, xazax.hun, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D34913
llvm-svn: 307818
Diffstat (limited to 'clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp b/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp index 701dd53dbb1..119f3c0db8b 100644 --- a/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp @@ -13,6 +13,7 @@ #include "CloexecCreatCheck.h" #include "CloexecFopenCheck.h" #include "CloexecOpenCheck.h" +#include "CloexecSocketCheck.h" using namespace clang::ast_matchers; @@ -27,6 +28,7 @@ public: CheckFactories.registerCheck<CloexecCreatCheck>("android-cloexec-creat"); CheckFactories.registerCheck<CloexecFopenCheck>("android-cloexec-fopen"); CheckFactories.registerCheck<CloexecOpenCheck>("android-cloexec-open"); + CheckFactories.registerCheck<CloexecSocketCheck>("android-cloexec-socket"); } }; |