projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hold DTR down for at least two seconds (from muller@nprdc.arpa)
[unix-history]
/
usr
/
src
/
libexec
/
getty
/
main.c
diff --git
a/usr/src/libexec/getty/main.c
b/usr/src/libexec/getty/main.c
index
aab4817
..
99b1e97
100644
(file)
--- a/
usr/src/libexec/getty/main.c
+++ b/
usr/src/libexec/getty/main.c
@@
-11,7
+11,7
@@
char copyright[] =
#endif not lint
#ifndef lint
#endif not lint
#ifndef lint
-static char sccsid[] = "@(#)main.c 5.
1
(Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 5.
4
(Berkeley) %G%";
#endif not lint
/*
#endif not lint
/*
@@
-118,7
+118,7
@@
main(argc, argv)
/*
signal(SIGQUIT, SIG_DFL);
*/
/*
signal(SIGQUIT, SIG_DFL);
*/
- openlog("getty", LOG_ODELAY|LOG_CONS,
0
);
+ openlog("getty", LOG_ODELAY|LOG_CONS,
LOG_AUTH
);
gethostname(hostname, sizeof(hostname));
if (hostname[0] == '\0')
strcpy(hostname, "Amnesiac");
gethostname(hostname, sizeof(hostname));
if (hostname[0] == '\0')
strcpy(hostname, "Amnesiac");
@@
-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++;