Merge "init: Introduce RequiresConsole()"
This commit is contained in:
commit
f2934de9c1
2 changed files with 6 additions and 1 deletions
|
|
@ -240,7 +240,7 @@ Result<void> SetProcessAttributes(const ProcessAttributes& attr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!attr.console.empty()) {
|
if (RequiresConsole(attr)) {
|
||||||
setsid();
|
setsid();
|
||||||
OpenConsole(attr.console);
|
OpenConsole(attr.console);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,11 @@ struct ProcessAttributes {
|
||||||
int priority;
|
int priority;
|
||||||
bool stdio_to_kmsg;
|
bool stdio_to_kmsg;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline bool RequiresConsole(const ProcessAttributes& attr) {
|
||||||
|
return !attr.console.empty();
|
||||||
|
}
|
||||||
|
|
||||||
Result<void> SetProcessAttributes(const ProcessAttributes& attr);
|
Result<void> SetProcessAttributes(const ProcessAttributes& attr);
|
||||||
|
|
||||||
Result<void> WritePidToFiles(std::vector<std::string>* files);
|
Result<void> WritePidToFiles(std::vector<std::string>* files);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue