acquire global lock first
This commit is contained in:
parent
9626f383d3
commit
616dca89ca
@ -97,9 +97,6 @@ mount(std::vector<const char *> args, std::string data_directory,
|
|||||||
}
|
}
|
||||||
#endif // defined(_WIN32)
|
#endif // defined(_WIN32)
|
||||||
|
|
||||||
auto drive_args = utils::cli::parse_drive_options(args, prov, data_directory);
|
|
||||||
app_config config(prov, data_directory);
|
|
||||||
{
|
|
||||||
lock_data global_lock(provider_type::unknown, "global");
|
lock_data global_lock(provider_type::unknown, "global");
|
||||||
lock_result = global_lock.grab_lock();
|
lock_result = global_lock.grab_lock();
|
||||||
if (lock_result != lock_result::success) {
|
if (lock_result != lock_result::success) {
|
||||||
@ -107,13 +104,15 @@ mount(std::vector<const char *> args, std::string data_directory,
|
|||||||
return exit_code::lock_failed;
|
return exit_code::lock_failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto drive_args = utils::cli::parse_drive_options(args, prov, data_directory);
|
||||||
|
app_config config(prov, data_directory);
|
||||||
|
{
|
||||||
|
|
||||||
std::uint16_t port{};
|
std::uint16_t port{};
|
||||||
if (not utils::get_next_available_port(config.get_api_port(), port)) {
|
if (not utils::get_next_available_port(config.get_api_port(), port)) {
|
||||||
std::cerr << "FATAL: Unable to get available port" << std::endl;
|
std::cerr << "FATAL: Unable to get available port" << std::endl;
|
||||||
return exit_code::startup_exception;
|
return exit_code::startup_exception;
|
||||||
}
|
}
|
||||||
global_lock.release();
|
|
||||||
|
|
||||||
config.set_api_port(port);
|
config.set_api_port(port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user