Skip to content

Commit

Permalink
change log.Fatal to log.Error to make subsequent os.Exit executable
Browse files Browse the repository at this point in the history
Signed-off-by: Abirdcfly <[email protected]>
  • Loading branch information
Abirdcfly committed Aug 6, 2022
1 parent 88fc4e4 commit 21a702e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/easeprobe/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ func main() {

c, err := conf.New(yamlFile)
if err != nil {
log.Fatalln("Fatal: Cannot read the YAML configuration file!")
log.Errorln("Fatal: Cannot read the YAML configuration file!")
os.Exit(-1)
}

// Create the pid file if the file name is not empty
if len(strings.TrimSpace(c.Settings.PIDFile)) > 0 {
d, err := daemon.NewPIDFile(c.Settings.PIDFile)
if err != nil {
log.Fatalf("Fatal: Cannot create the PID file: %s!", err)
log.Errorf("Fatal: Cannot create the PID file: %s!", err)
os.Exit(-1)
}
log.Infof("Successfully created the PID file: %s", d.PIDFile)
Expand Down

0 comments on commit 21a702e

Please sign in to comment.