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();
|
||||
OpenConsole(attr.console);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -95,6 +95,11 @@ struct ProcessAttributes {
|
|||
int priority;
|
||||
bool stdio_to_kmsg;
|
||||
};
|
||||
|
||||
inline bool RequiresConsole(const ProcessAttributes& attr) {
|
||||
return !attr.console.empty();
|
||||
}
|
||||
|
||||
Result<void> SetProcessAttributes(const ProcessAttributes& attr);
|
||||
|
||||
Result<void> WritePidToFiles(std::vector<std::string>* files);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue