HomePhabricator

[clang-tidy] Refactor the code and add a close-on-exec check on memfd_create()…

Authored by yawanng on Aug 10 2017, 10:18 AM.

Description

[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