Lines 949-954
Link Here
|
949 |
sigprocmask(SIG_SETMASK, &omask, NULL); |
949 |
sigprocmask(SIG_SETMASK, &omask, NULL); |
950 |
|
950 |
|
951 |
/* |
951 |
/* |
|
|
952 |
* Update utmp/wtmp file prior to starting |
953 |
* any child. This MUST be done right here in |
954 |
* the child process in order to prevent a race |
955 |
* condition that occurs when the child |
956 |
* process' time slice executes before the |
957 |
* parent (can and does happen in a uniprocessor |
958 |
* environment). If the child is a getty and |
959 |
* the race condition happens, then init's utmp |
960 |
* update will happen AFTER the getty runs |
961 |
* and expects utmp to be updated already! |
962 |
* |
963 |
* Do NOT log if process field starts with '+' |
964 |
* FIXME: that's for compatibility with *very* |
965 |
* old getties - probably it can be taken out. |
966 |
*/ |
967 |
if (ch->action == RESPAWN && ch->process[0] != '+') |
968 |
write_utmp_wtmp("", ch->id, getpid(), INIT_PROCESS, ""); |
969 |
|
970 |
/* |
952 |
* In sysinit, boot, bootwait or single user mode: |
971 |
* In sysinit, boot, bootwait or single user mode: |
953 |
* for any wait-type subprocess we _force_ the console |
972 |
* for any wait-type subprocess we _force_ the console |
954 |
* to be its controlling tty. |
973 |
* to be its controlling tty. |
Lines 1088-1102
Link Here
|
1088 |
case ONDEMAND: |
1107 |
case ONDEMAND: |
1089 |
case RESPAWN: |
1108 |
case RESPAWN: |
1090 |
ch->flags |= RUNNING; |
1109 |
ch->flags |= RUNNING; |
1091 |
if (spawn(ch, &(ch->pid)) < 0) break; |
1110 |
(void)spawn(ch, &(ch->pid)); |
1092 |
/* |
|
|
1093 |
* Do NOT log if process field starts with '+' |
1094 |
* FIXME: that's for compatibility with *very* |
1095 |
* old getties - probably it can be taken out. |
1096 |
*/ |
1097 |
if (ch->process[0] != '+') |
1098 |
write_utmp_wtmp("", ch->id, ch->pid, |
1099 |
INIT_PROCESS, ""); |
1100 |
break; |
1111 |
break; |
1101 |
} |
1112 |
} |
1102 |
} |
1113 |
} |