summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-12-09 20:20:44 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-12-09 20:20:44 +0000
commit60420622ad6b5deb4c1d6c248470505b1c822301 (patch)
tree29dc1db7822d505bc3c46f4e0cc29e3a3eccc5ee /libexec
parentb0b71031680fe59efbf9d83cba6c0d942eb92323 (diff)
oops
Diffstat (limited to 'libexec')
-rw-r--r--libexec/getty/main.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libexec/getty/main.c b/libexec/getty/main.c
index 55910b4c2e6..8a2439fa75f 100644
--- a/libexec/getty/main.c
+++ b/libexec/getty/main.c
@@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)main.c 8.1 (Berkeley) 6/20/93";*/
-static char rcsid[] = "$Id: main.c,v 1.13 1999/12/07 19:24:27 deraadt Exp $";
+static char rcsid[] = "$Id: main.c,v 1.14 1999/12/09 20:20:43 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -202,12 +202,9 @@ main(argc, argv)
* that the file descriptors are already set up for us.
* J. Gettys - MIT Project Athena.
*/
- if (isatty(0) == 0) {
- fprintf(stderr, "not a tty\n");
- exit(1);
- } else if (argc <= 2 || strcmp(argv[2], "-") == 0)
- strlcpy(ttyn, ttyname(0), sizeof(ttyn));
- else {
+ if (argc <= 2 || strcmp(argv[2], "-") == 0) {
+ snprintf(ttyn, sizeof ttyn, "%s", ttyname(0));
+ } else {
int i;
snprintf(ttyn, sizeof ttyn, "%s%s", dev, argv[2]);