From 4395339a2dc410bcf49f3e24f9ed3024fdb25b0a Mon Sep 17 00:00:00 2001 From: Lucas Reis Date: Mon, 11 Mar 2024 14:14:34 -0400 Subject: [PATCH] core: Fix typo and check correct grandchild PID in spawn() (#34) --- src/core/Hypridle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Hypridle.cpp b/src/core/Hypridle.cpp index c38fcb5..1687b32 100644 --- a/src/core/Hypridle.cpp +++ b/src/core/Hypridle.cpp @@ -249,9 +249,9 @@ static void spawn(const std::string& args) { close(socket[1]); read(socket[0], &grandchild, sizeof(grandchild)); close(socket[0]); - // clear child and leave child to init + // clear child and leave grandchild to init waitpid(child, NULL, 0); - if (child < 0) { + if (grandchild < 0) { Debug::log(LOG, "Failed to create the second fork"); return; }