|
@@ -151,17 +151,14 @@ func monitorMain(runtimeOptions RuntimeOptions) {
|
|
// Successful exit indicates an intentional shutdown
|
|
// Successful exit indicates an intentional shutdown
|
|
return
|
|
return
|
|
} else if exiterr, ok := err.(*exec.ExitError); ok {
|
|
} else if exiterr, ok := err.(*exec.ExitError); ok {
|
|
- if status, ok := exiterr.Sys().(syscall.WaitStatus); ok {
|
|
|
|
- switch status.ExitStatus() {
|
|
|
|
- case syncthing.ExitUpgrade.AsInt():
|
|
|
|
- // Restart the monitor process to release the .old
|
|
|
|
- // binary as part of the upgrade process.
|
|
|
|
- l.Infoln("Restarting monitor...")
|
|
|
|
- if err = restartMonitor(args); err != nil {
|
|
|
|
- l.Warnln("Restart:", err)
|
|
|
|
- }
|
|
|
|
- return
|
|
|
|
|
|
+ if exiterr.ExitCode() == syncthing.ExitUpgrade.AsInt() {
|
|
|
|
+ // Restart the monitor process to release the .old
|
|
|
|
+ // binary as part of the upgrade process.
|
|
|
|
+ l.Infoln("Restarting monitor...")
|
|
|
|
+ if err = restartMonitor(args); err != nil {
|
|
|
|
+ l.Warnln("Restart:", err)
|
|
}
|
|
}
|
|
|
|
+ return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|