From db6745e8ff034552ef87d4a45220428b87823e67 Mon Sep 17 00:00:00 2001 From: Alex X Date: Tue, 18 Jun 2024 20:35:17 +0300 Subject: [PATCH] Code refactoring after #1168 --- internal/app/app.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/internal/app/app.go b/internal/app/app.go index cdbb870b..eb803584 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -45,17 +45,7 @@ func Init() { os.Exit(0) } - ppid := os.Getppid() - if ppid == 1 { - daemon = false - } else { - parent, err := os.FindProcess(ppid) - if err != nil || parent.Pid < 1 { - daemon = false - } - } - - if daemon { + if daemon && os.Getppid() != 1 { if runtime.GOOS == "windows" { fmt.Println("Daemon mode is not supported on Windows") os.Exit(1)