Code refactoring after #1168
This commit is contained in:
+1
-11
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user