summaryrefslogtreecommitdiffstats
path: root/sbin/init/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/init/init.c')
-rw-r--r--sbin/init/init.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c
index e7b6fa6..5164f5a 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -1081,8 +1081,18 @@ start_getty(sp)
pid_t pid;
sigset_t mask;
time_t current_time = time((time_t *) 0);
+ int too_quick = 0;
char term[64], *env[2];
+ if (current_time > sp->se_started &&
+ current_time - sp->se_started < GETTY_SPACING) {
+ if (++sp->se_nspace > GETTY_NSPACE) {
+ sp->se_nspace = 0;
+ too_quick = 1;
+ }
+ } else
+ sp->se_nspace = 0;
+
/*
* fork(), not vfork() -- we can't afford to block.
*/
@@ -1094,17 +1104,11 @@ start_getty(sp)
if (pid)
return pid;
- if (current_time > sp->se_started &&
- current_time - sp->se_started < GETTY_SPACING) {
- if (++sp->se_nspace > GETTY_NSPACE) {
- sp->se_nspace = 0;
- warning("getty repeating too quickly on port %s, sleeping %d secs",
- sp->se_device, GETTY_SLEEP);
+ if (too_quick) {
+ warning("getty repeating too quickly on port %s, sleeping %d secs",
+ sp->se_device, GETTY_SLEEP);
sleep((unsigned) GETTY_SLEEP);
}
- }
- else
- sp->se_nspace = 0;
if (sp->se_window) {
start_window_system(sp);
OpenPOWER on IntegriCloud