From a43930483d8704287c741e40f600d2ed1562084e Mon Sep 17 00:00:00 2001 From: gouzi <530971494@qq.com> Date: Mon, 14 Aug 2023 11:53:07 +0800 Subject: [PATCH] =?UTF-8?q?[clang-tidy]=20Open=20clang-analyzer-unix.Vfork?= =?UTF-8?q?=E3=80=81clang-analyzer-security.insecureAPI.vfork=20Check?= 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 7c1f905f2eb3c..e8d5e1d7ea880 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 312122b45f3d6..aee778d9ba450 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) {