Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/getty getty: Remove 2 second sleep before opening tty



details:   https://anonhg.NetBSD.org/src/rev/a1a439a57fd8
branches:  trunk
changeset: 989152:a1a439a57fd8
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Oct 12 23:40:38 2021 +0000

description:
getty: Remove 2 second sleep before opening tty

This (apparently very old!) workaround to ensure that DTR stays down long
enough to be detected is now handled by serial drivers themselves. For
console devices (framebuffer, serial console, etc) this was an unnecessary
2 second penalty that we have all been paying since the beginning of time.

diffstat:

 libexec/getty/main.c |  9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diffs (30 lines):

diff -r 568ec76e7c0d -r a1a439a57fd8 libexec/getty/main.c
--- a/libexec/getty/main.c      Tue Oct 12 22:51:28 2021 +0000
+++ b/libexec/getty/main.c      Tue Oct 12 23:40:38 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.67 2020/02/26 15:44:57 riastradh Exp $      */
+/*     $NetBSD: main.c,v 1.68 2021/10/12 23:40:38 jmcneill Exp $       */
 
 /*-
  * Copyright (c) 1980, 1993
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "from: @(#)main.c       8.1 (Berkeley) 6/20/93";
 #else
-__RCSID("$NetBSD: main.c,v 1.67 2020/02/26 15:44:57 riastradh Exp $");
+__RCSID("$NetBSD: main.c,v 1.68 2021/10/12 23:40:38 jmcneill Exp $");
 #endif
 #endif /* not lint */
 
@@ -229,11 +229,6 @@
                        if (ttyaction(ttyn, "getty", "root"))
                                syslog(LOG_WARNING, "%s: ttyaction failed",
                                        ttyn);
-                       /*
-                        * Delay the open so DTR stays down long enough
-                        * to be detected.
-                        */
-                       (void)sleep(2);
                        while ((i = open(ttyn, O_RDWR)) == -1) {
                                if ((repcnt % 10 == 0) &&
                                    (errno != ENXIO || !failopenlogged)) {



Home | Main Index | Thread Index | Old Index