mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-11 16:49:22 +08:00
packages.info: use biu::exec
This commit is contained in:
@@ -156,17 +156,8 @@ int main()
|
||||
if (context == "epilog_slurmctld" && !output_file.empty())
|
||||
{
|
||||
auto text = "\n--------------------\n{}\n--------------------\n"_f(info);
|
||||
boost::asio::io_context context;
|
||||
boost::system::error_code ec;
|
||||
boost::asio::writable_pipe wp{context};
|
||||
boost::process::v2::process proc
|
||||
(
|
||||
context, "/run/current-system/sw/bin/tee", { "-a", output_file.c_str() },
|
||||
boost::process::v2::process_stdio{wp, nullptr, nullptr}, switch_user(uid, gid)
|
||||
);
|
||||
boost::asio::write(wp, boost::asio::buffer(text));
|
||||
wp.close();
|
||||
proc.wait();
|
||||
biu::exec<{.SearchPath = true, .Stdin = biu::IoType::String}>
|
||||
({.Program = "tee", .Args = { "-a", output_file }, .Stdin = text}, switch_user(uid, gid));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user