opt: avoid spawn null cmd

This commit is contained in:
DreamMaoMao 2025-05-16 16:04:06 +08:00
parent 8b752adcd4
commit 56b45dece2

View file

@ -6104,6 +6104,10 @@ void setup(void) {
} }
void spawn(const Arg *arg) { void spawn(const Arg *arg) {
if(!arg->v)
return;
if (fork() == 0) { if (fork() == 0) {
// 1. 忽略可能导致 coredump 的信号 // 1. 忽略可能导致 coredump 的信号
signal(SIGSEGV, SIG_IGN); signal(SIGSEGV, SIG_IGN);