Skip to content

Commit db6745e

Browse files
committed
Code refactoring after #1168
1 parent 72d7e8a commit db6745e

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

internal/app/app.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,7 @@ func Init() {
4545
os.Exit(0)
4646
}
4747

48-
ppid := os.Getppid()
49-
if ppid == 1 {
50-
daemon = false
51-
} else {
52-
parent, err := os.FindProcess(ppid)
53-
if err != nil || parent.Pid < 1 {
54-
daemon = false
55-
}
56-
}
57-
58-
if daemon {
48+
if daemon && os.Getppid() != 1 {
5949
if runtime.GOOS == "windows" {
6050
fmt.Println("Daemon mode is not supported on Windows")
6151
os.Exit(1)

0 commit comments

Comments
 (0)