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
clean up awk syntax
[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
..
b1b26a4
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.
5
(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");
@@
-130,15
+130,20
@@
main(argc, argv)
* J. Gettys - MIT Project Athena.
*/
if (argc <= 2 || strcmp(argv[2], "-") == 0)
* J. Gettys - MIT Project Athena.
*/
if (argc <= 2 || strcmp(argv[2], "-") == 0)
-
strcpy(ttyn, ttyname(0));
+ strcpy(ttyn, ttyname(0));
else {
else {
- strcpy(ttyn, dev);
- strncat(ttyn, argv[2], sizeof(ttyn)-sizeof(dev));
+ strcpy(ttyn, dev);
+ strncat(ttyn, argv[2], sizeof(ttyn)-sizeof(dev));
+ if (strcmp(argv[0], "+") != 0) {
chown(ttyn, 0, 0);
chmod(ttyn, 0622);
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++;
@@
-151,6
+156,7
@@
main(argc, argv)
dup(1);
dup(0);
signal(SIGHUP, SIG_DFL);
dup(1);
dup(0);
signal(SIGHUP, SIG_DFL);
+ }
}
gettable("default", defent, defstrs);
}
gettable("default", defent, defstrs);