Merge "init: Introduce RequiresConsole()" am: f2934de9c1
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2303437 Change-Id: I02cc8a62019ead190348d1d796f1daa04215b6c3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
22ac02c57c
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