hold DTR down for at least two seconds (from muller@nprdc.arpa)
[unix-history] / usr / src / libexec / getty / main.c
index b9fcd3c..99b1e97 100644 (file)
@@ -11,7 +11,7 @@ char copyright[] =
 #endif not lint
 
 #ifndef lint
 #endif not lint
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     5.4 (Berkeley) %G%";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -136,9 +136,13 @@ main(argc, argv)
                strncat(ttyn, argv[2], sizeof(ttyn)-sizeof(dev));
                chown(ttyn, 0, 0);
                chmod(ttyn, 0622);
                strncat(ttyn, argv[2], sizeof(ttyn)-sizeof(dev));
                chown(ttyn, 0, 0);
                chmod(ttyn, 0622);
+               /*
+                * Delay the open so DTR stays down long enough to be detected.
+                */
+               sleep(2);
                while (open(ttyn, O_RDWR) != 0) {
                        if (repcnt % 10 == 0) {
                while (open(ttyn, O_RDWR) != 0) {
                        if (repcnt % 10 == 0) {
-                               syslog(LOG_FAIL, "%s: %m", ttyn);
+                               syslog(LOG_ERR, "%s: %m", ttyn);
                                closelog();
                        }
                        repcnt++;
                                closelog();
                        }
                        repcnt++;