From bebd8be67bd8fc8e832faf0ed635f9e8a46ca126 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 22 Mar 2001 11:58:15 +1100 Subject: - (djm) Better AIX no tty fix, spotted by Gert Doering --- session.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'session.c') diff --git a/session.c b/session.c index bed03c746..a794f3b2d 100644 --- a/session.c +++ b/session.c @@ -1134,11 +1134,12 @@ do_child(Session *s, const char *command) * other stuff is stored - a few applications * actually use this and die if it's not set */ + if (s->ttyfd == -1) + s->tty[0] = '\0'; cp = xmalloc(22 + strlen(s->tty) + 2 * strlen(pw->pw_name)); i = sprintf(cp, "LOGNAME=%s%cNAME=%s%cTTY=%s%c%c", - pw->pw_name, 0, pw->pw_name, 0, - s->ttyfd == -1 ? "" : s->tty, 0,0); + pw->pw_name, 0, pw->pw_name, 0, s->tty, 0, 0); if (usrinfo(SETUINFO, cp, i) == -1) fatal("Couldn't set usrinfo: %s", strerror(errno)); -- cgit v1.2.3