From 2e6f9a16f936d3ef754cdb1bd0dd59a8680f374d Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Mon, 14 Aug 2017 17:25:41 +0000 Subject: [clang-tidy] Add a close-on-exec check on inotify_init() in Android module. Summary: inotify_init() is better to be replaced by inotify_init1() with IN_CLOEXEC flag to avoid file descriptor leakage. Differential Revision: https://reviews.llvm.org/D35370 llvm-svn: 310861 --- clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp') diff --git a/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp b/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp index 71c6accba97..316d228a7b0 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 "CloexecInotifyInitCheck.h" #include "CloexecMemfdCreateCheck.h" #include "CloexecOpenCheck.h" #include "CloexecSocketCheck.h" @@ -30,6 +31,8 @@ public: CheckFactories.registerCheck("android-cloexec-creat"); CheckFactories.registerCheck("android-cloexec-dup"); CheckFactories.registerCheck("android-cloexec-fopen"); + CheckFactories.registerCheck( + "android-cloexec-inotify-init"); CheckFactories.registerCheck( "android-cloexec-memfd-create"); CheckFactories.registerCheck("android-cloexec-open"); -- cgit v1.2.3