libutil: remove unused RunOptions::{chdir, createSession}
Change-Id: Ib2b9f5c094233661a01ad8cea30a44e11931c941
This commit is contained in:
@@ -350,9 +350,6 @@ RunningProgram runProgram2(const RunOptions & options)
|
||||
/* Fork. */
|
||||
Pid pid{startProcess(
|
||||
[&]() {
|
||||
if (options.createSession && setsid() == -1) {
|
||||
throw SysError("setsid");
|
||||
}
|
||||
if (options.environment) {
|
||||
replaceEnv(*options.environment);
|
||||
}
|
||||
@@ -371,10 +368,6 @@ RunningProgram runProgram2(const RunOptions & options)
|
||||
}
|
||||
}
|
||||
|
||||
if (options.chdir && sys::chdir(*options.chdir) == -1) {
|
||||
throw SysError("chdir failed");
|
||||
}
|
||||
|
||||
#if __linux__
|
||||
if (!options.caps.empty() && prctl(PR_SET_KEEPCAPS, 1) < 0) {
|
||||
throw SysError("setting keep-caps failed");
|
||||
|
||||
@@ -109,10 +109,8 @@ struct RunOptions
|
||||
Strings args = {};
|
||||
std::optional<uid_t> uid = {};
|
||||
std::optional<uid_t> gid = {};
|
||||
std::optional<Path> chdir = {};
|
||||
std::optional<std::map<std::string, std::string>> environment = {};
|
||||
bool captureStdout = false;
|
||||
bool createSession = false;
|
||||
std::vector<Redirection> redirections;
|
||||
#if __linux__
|
||||
std::set<long> caps;
|
||||
|
||||
Reference in New Issue
Block a user