From a2fe1e244fe667e390f38d558b09814b1808c4f4 Mon Sep 17 00:00:00 2001 From: gouzil <66515297+gouzil@users.noreply.github.com> Date: Tue, 15 Aug 2023 11:49:52 +0800 Subject: [PATCH] =?UTF-8?q?[clang-tidy]=20Open=20clang-analyzer-unix.Vfork?= =?UTF-8?q?=E3=80=81clang-analyzer-security.insecureAPI.vfork=20Check=20(#?= =?UTF-8?q?56253)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .clang-tidy | 4 ++-- paddle/fluid/framework/io/shell.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 8c70a22e826..a3847a6ec11 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -137,13 +137,13 @@ bugprone-unused-raii, -clang-analyzer-security.insecureAPI.mktemp, -clang-analyzer-security.insecureAPI.rand, -clang-analyzer-security.insecureAPI.strcpy, --clang-analyzer-security.insecureAPI.vfork, +clang-analyzer-security.insecureAPI.vfork, -clang-analyzer-unix.API, -clang-analyzer-unix.DynamicMemoryModeling, -clang-analyzer-unix.Malloc, -clang-analyzer-unix.MallocSizeof, -clang-analyzer-unix.MismatchedDeallocator, --clang-analyzer-unix.Vfork, +clang-analyzer-unix.Vfork, -clang-analyzer-unix.cstring.BadSizeArg, -clang-analyzer-unix.cstring.CStringModeling, -clang-analyzer-unix.cstring.NullArg, diff --git a/paddle/fluid/framework/io/shell.cc b/paddle/fluid/framework/io/shell.cc index 46456df6e68..b710289b091 100644 --- a/paddle/fluid/framework/io/shell.cc +++ b/paddle/fluid/framework/io/shell.cc @@ -117,7 +117,7 @@ static int shell_popen_fork_internal(const char* real_cmd, int child_pid = -1; // Too frequent calls to fork() makes openmpi very slow. Use vfork() instead. // But vfork() is very dangerous. Be careful. - if ((child_pid = vfork()) < 0) { + if ((child_pid = vfork()) < 0) { // NOLINT return -1; } @@ -127,7 +127,7 @@ static int shell_popen_fork_internal(const char* real_cmd, return child_pid; } - int child_std_end = do_read ? 1 : 0; + int child_std_end = do_read ? 1 : 0; // NOLINT close(parent_end); if (child_end != child_std_end) { -- GitLab