From 56b45dece2772b54338e4938fd2e5b712884e5de Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Fri, 16 May 2025 16:04:06 +0800 Subject: [PATCH] opt: avoid spawn null cmd --- src/maomao.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/maomao.c b/src/maomao.c index 52d049c..13f72b5 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -6104,6 +6104,10 @@ void setup(void) { } void spawn(const Arg *arg) { + + if(!arg->v) + return; + if (fork() == 0) { // 1. 忽略可能导致 coredump 的信号 signal(SIGSEGV, SIG_IGN);