From 228d7ef2cc25606c404d9ba96fccbefd51426888 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Tue, 8 Aug 1995 02:29:12 +0000 Subject: [PATCH] nspace count was incremented only in child, so warning never displayed Pointed by: Mike Pritchard --- sbin/init/init.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/sbin/init/init.c b/sbin/init/init.c index e7b6fa68ff9e..5164f5a65d05 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);