Commit Graph

5 Commits

Author SHA1 Message Date
Chih-Hung Hsieh fec506daaa [clang-tidy] Use CloexecCheck as base class.
Summary:
Simplify registerMatchers and check functions in CloexecCreatCheck,
CloexecSocketCheck, CloexecFopenCheck, and CloexecOpenCheck.

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

llvm-svn: 311020
2017-08-16 16:59:26 +00:00
Chih-Hung Hsieh 56650e7fc5 [clang-tidy] Add a close-on-exec check on dup() in Android module.
Summary:
dup() is better to be replaced by fcntl() to avoid file descriptor leakage.

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

llvm-svn: 310858
2017-08-14 17:04:16 +00:00
Yan Wang b21739f988 [clang-tidy] Fix for buildbot.
Summary:
Fix an issue for windows.

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

llvm-svn: 310669
2017-08-10 22:09:22 +00:00
Reid Kleckner 8d4d57035f Revert "[clang-tidy] Refactor the code and add a close-on-exec check on memfd_create() in Android module."
This reverts commit r310630.

The new code broke on Windows and was untested. On Linux, it was
selecting the "int" overload of operator<<, which definitely does not
print the right thing when fed a "Mode" char.

llvm-svn: 310661
2017-08-10 21:21:15 +00:00
Yan Wang d61c2a18cb [clang-tidy] Refactor the code and add a close-on-exec check on memfd_create() in Android module.
Summary:
1. Refactor the structure of the code by adding a base class for all close-on-exec checks, which implements most of the needed functions.
2. memfd_create() is better to set MFD_CLOEXEC flag to avoid file descriptor leakage.

Reviewers: alexfh, aaron.ballman, hokein

Reviewed By: alexfh, hokein

Subscribers: Eugene.Zelenko, chh, cfe-commits, srhines, mgorny, JDevlieghere, xazax.hun

Tags: #clang-tools-extra

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

llvm-svn: 310630
2017-08-10 17:18:10 +00:00