summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2017-08-14 17:45:48 +0000
committerChih-Hung Hsieh <chh@google.com>2017-08-14 17:45:48 +0000
commit7651e66cdfd24425f0fcaadf3cc892a47e6cb37e (patch)
treed0fb06c88654986b9777d153aaee2fdf10ff9ef6 /clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp
parent2e6f9a16f936d3ef754cdb1bd0dd59a8680f374d (diff)
downloadbcm5719-llvm-7651e66cdfd24425f0fcaadf3cc892a47e6cb37e.tar.gz
bcm5719-llvm-7651e66cdfd24425f0fcaadf3cc892a47e6cb37e.zip
[clang-tidy] Add a close-on-exec check on inotify_init1() in Android module.
Summary: inotify_init1() is better to set IN_CLOEXEC flag to avoid file descriptor leakage. Differential Revision: https://reviews.llvm.org/D35368 llvm-svn: 310863
Diffstat (limited to 'clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp b/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp
index 316d228a7b0..aca2d5f1ae5 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 "CloexecDupCheck.h"
#include "CloexecFopenCheck.h"
+#include "CloexecInotifyInit1Check.h"
#include "CloexecInotifyInitCheck.h"
#include "CloexecMemfdCreateCheck.h"
#include "CloexecOpenCheck.h"
@@ -33,6 +34,8 @@ public:
CheckFactories.registerCheck<CloexecFopenCheck>("android-cloexec-fopen");
CheckFactories.registerCheck<CloexecInotifyInitCheck>(
"android-cloexec-inotify-init");
+ CheckFactories.registerCheck<CloexecInotifyInit1Check>(
+ "android-cloexec-inotify-init1");
CheckFactories.registerCheck<CloexecMemfdCreateCheck>(
"android-cloexec-memfd-create");
CheckFactories.registerCheck<CloexecOpenCheck>("android-cloexec-open");
OpenPOWER on IntegriCloud