From caba86e5d2c05a270b81d3bcd9151d74997e8104 Mon Sep 17 00:00:00 2001 From: jmcneill Date: Tue, 12 Oct 2021 23:40:38 +0000 Subject: [PATCH] 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. --- libexec/getty/main.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/libexec/getty/main.c b/libexec/getty/main.c index 7da112870fc0..cfffb3e9e7ed 100644 --- a/libexec/getty/main.c +++ b/libexec/getty/main.c @@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\ #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 @@ main(int argc, char *argv[], char *envp[]) 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)) {