From e03d112d7a76b09de0dc8af7b91acea57aab8402 Mon Sep 17 00:00:00 2001 From: "qcqcqc@wsl" <1220204124@zust.edu.cn> Date: Sat, 12 Apr 2025 10:51:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/exec_hook.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/exec_hook.h b/src/exec_hook.h index e83de8c..389d395 100644 --- a/src/exec_hook.h +++ b/src/exec_hook.h @@ -22,7 +22,7 @@ #define COMMAND_NOT_FOUND "/usr/lib/command-not-found" -#ifdef DEBUG //如果是debug模式,在本地目录生成log,方便debug +#ifdef DEBUG // 如果是debug模式,在本地目录生成log,方便debug #define LOG_FILE "./logs/execve.log" #define LOG_OUT_FILE "./logs/execve_out.log" @@ -37,19 +37,18 @@ #define MAX_PATH_LEN 256 -#define GET_LOG_FILE(c_pid, is_stdout) ({ \ - static char filename[MAX_PATH_LEN]; \ - snprintf(filename, MAX_PATH_LEN, "%s.%ld.%s", \ - LOG_OUT_FILE, \ - (long)c_pid, \ - (is_stdout) ? "stdout" : "stderr"); \ - filename; \ -}) +#define GET_LOG_FILE(c_pid, is_stdout) \ + ({ \ + static char filename[MAX_PATH_LEN]; \ + snprintf(filename, MAX_PATH_LEN, "%s.%ld.%s", LOG_OUT_FILE, \ + (long)c_pid, (is_stdout) ? "stdout" : "stderr"); \ + filename; \ + }) #define ANSI_COLOR_RED "\033[31m" #define ANSI_COLOR_YELLOW "\033[33m" #define ANSI_COLOR_RESET "\033[0m" -#define ANSI_COLOR_BLUE "\x1b[34m" +#define ANSI_COLOR_BLUE "\x1b[34m" #define SHM_KEY 0x78945 #define SHM_SIZE 512 * 1024