Yield execution in forked children back to PID 1

- Speeds up start-up a bit
 - Ensures the child is moved to its cgroup as soon as possible

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-04-09 18:59:33 +02:00
parent d373068619
commit c85e28b971
3 changed files with 9 additions and 1 deletions
+4
View File
@@ -389,6 +389,8 @@ pid_t run_getty(char *tty, char *baud, char *term, int noclear, int nowait, stru
speed_t speed;
int rc = 1;
sched_yield();
speed = stty_parse_speed(baud);
prepare_tty(tty, speed, "tty", rlimit);
if (activate_console(noclear, nowait)) {
@@ -412,6 +414,8 @@ pid_t run_getty2(char *tty, char *cmd, char *args[], int noclear, int nowait, st
if (!pid) {
int rc = 1;
sched_yield();
/* Dunno speed, tell stty() to not mess with it */
prepare_tty(tty, B0, "getty", rlimit);
if (activate_console(noclear, nowait)) {