Allow restarting Syncthing when the built-in Syncthing library is used
This commit is contained in:
parent
8f78d14215
commit
fa5a7b5c64
|
@ -164,10 +164,17 @@ std::int64_t runSyncthing(const RuntimeOptions &options)
|
|||
if (!runningState) {
|
||||
return -1;
|
||||
}
|
||||
return ::libst_run_syncthing(gostr(options.configDir), gostr(options.dataDir), gostr(options.guiAddress), gostr(options.guiApiKey),
|
||||
options.flags & RuntimeFlags::Verbose, options.flags & RuntimeFlags::AllowNewerConfig, options.flags & RuntimeFlags::NoDefaultConfig,
|
||||
options.flags & RuntimeFlags::SkipPortProbing, options.flags & RuntimeFlags::EnsureConfigDirExists,
|
||||
options.flags & RuntimeFlags::EnsureDataDirExists, options.flags & RuntimeFlags::ExpandPathsFromEnv);
|
||||
for (;;) {
|
||||
const auto exitCode
|
||||
= ::libst_run_syncthing(gostr(options.configDir), gostr(options.dataDir), gostr(options.guiAddress), gostr(options.guiApiKey),
|
||||
options.flags & RuntimeFlags::Verbose, options.flags & RuntimeFlags::AllowNewerConfig, options.flags & RuntimeFlags::NoDefaultConfig,
|
||||
options.flags & RuntimeFlags::SkipPortProbing, options.flags & RuntimeFlags::EnsureConfigDirExists,
|
||||
options.flags & RuntimeFlags::EnsureDataDirExists, options.flags & RuntimeFlags::ExpandPathsFromEnv);
|
||||
// return exit code unless it is "3" as this means Syncthing is supposed to be restarted
|
||||
if (exitCode != 3) {
|
||||
return exitCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
Loading…
Reference in New Issue