[PATCH] D35370: [clang-tidy] Add a close-on-exec check on inotify_init() in Android module.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 11 07:11:19 PDT 2017


hokein added inline comments.


================
Comment at: clang-tidy/android/CloexecInotifyInitCheck.cpp:27
+  replaceFunc(Result,
+              "prefer inotify_init() to inotify_init1() "
+              "because inotify_init1() allows IN_CLOEXEC",
----------------
The parameter 2 and 3 are not clear at the first glance. Maybe add `/*WarningMsg=*/`, and `/*FixMsg=*/`.


================
Comment at: test/clang-tidy/android-cloexec-inotify-init.cpp:8
+  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer inotify_init() to inotify_init1() because inotify_init1() allows IN_CLOEXEC [android-cloexec-inotify-init]
+  // CHECK-FIXES: inotify_init1(IN_CLOEXEC)
+}
----------------
nit: trailing `;`.


https://reviews.llvm.org/D35370





More information about the cfe-commits mailing list