diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2019-05-01 14:13:13 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2019-05-01 14:13:13 +0000 |
commit | 84057ac80e58841cfb56322bb96ed844707d7650 (patch) | |
tree | 357382f31383ec4a03eb11b14408d7986cbe3557 /libexec/getty | |
parent | 7b0c95d2faff3f0e343aa06da01726269547a45c (diff) |
Pull tname initialization up since it's used in an error path.
Pointed out by jsg, just fix it deraadt@
Diffstat (limited to 'libexec/getty')
-rw-r--r-- | libexec/getty/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libexec/getty/main.c b/libexec/getty/main.c index 23af8cf0cda..9469d8572d4 100644 --- a/libexec/getty/main.c +++ b/libexec/getty/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.51 2018/11/17 01:40:51 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.52 2019/05/01 14:13:12 florian Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -170,6 +170,8 @@ main(int argc, char *argv[]) ioctl(0, FIOASYNC, &off); /* turn off async mode */ + tname = "default"; + if (unveil(_PATH_GETTYTAB, "r") == -1) { syslog(LOG_ERR, "%s: %m", tname); exit(1); @@ -185,7 +187,6 @@ main(int argc, char *argv[]) gettable("default", defent); gendefaults(); - tname = "default"; if (argc > 1) tname = argv[1]; gettable(tname, tabent); |