fix
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
Scott E. Graves 2025-03-24 21:24:39 -05:00
parent 4d5e261cb8
commit 1df0a2cfd2

View File

@ -682,11 +682,8 @@ auto handlers::launch_process(provider_type prov, std::string_view name,
args.insert(std::next(args.begin(), 3U), ""); args.insert(std::next(args.begin(), 3U), "");
args.insert(std::next(args.begin(), 4U), "/MIN"); args.insert(std::next(args.begin(), 4U), "/MIN");
args.insert(std::next(args.begin(), 5U), repertory_binary_); args.insert(std::next(args.begin(), 5U), repertory_binary_);
#elif defined(__linux__) // defined(__linux__) #else // !defined(_WIN32)
args.insert(args.begin(), repertory_binary_); args.insert(args.begin(), repertory_binary_);
args.insert(std::next(args.begin()), "-f");
#else // !defined(__linux__) && !defined(_WIN32)
build fails here
#endif // defined(_WIN32) #endif // defined(_WIN32)
std::vector<const char *> exec_args; std::vector<const char *> exec_args;
@ -699,16 +696,9 @@ auto handlers::launch_process(provider_type prov, std::string_view name,
#if defined(_WIN32) #if defined(_WIN32)
_spawnv(_P_DETACH, exec_args.at(0U), _spawnv(_P_DETACH, exec_args.at(0U),
const_cast<char *const *>(exec_args.data())); const_cast<char *const *>(exec_args.data()));
#else #else // !defined(_WIN32)
auto pid = fork(); auto pid = fork();
if (pid < 0) { if (pid == 0) {
throw utils::error::create_exception(function_name, {"mount failed"});
}
if (pid != 0) {
return {};
}
setsid(); setsid();
chdir("/"); chdir("/");
close(STDIN_FILENO); close(STDIN_FILENO);
@ -719,6 +709,9 @@ auto handlers::launch_process(provider_type prov, std::string_view name,
open("/dev/null", O_WRONLY); open("/dev/null", O_WRONLY);
execvp(exec_args.at(0U), const_cast<char *const *>(exec_args.data())); execvp(exec_args.at(0U), const_cast<char *const *>(exec_args.data()));
} else {
signal(SIGCHLD, SIG_IGN);
}
#endif // defined(_WIN32) #endif // defined(_WIN32)
return {}; return {};
} }