summaryrefslogtreecommitdiff
path: root/daemons
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-07-06 17:58:34 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-07-06 17:58:34 +0000
commitcf8c44e3a5179851621a21d93ce83e1e778cd343 (patch)
tree947b55408c8015e7d6699cc4d13b81ea6dd3b674 /daemons
parentd9185de6346a26b7b4d3095e7e89352f364b0572 (diff)
(print_banner): Don't include directory in terminal name.
Diffstat (limited to 'daemons')
-rw-r--r--daemons/getty.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/daemons/getty.c b/daemons/getty.c
index 60809608..cc7e9fc6 100644
--- a/daemons/getty.c
+++ b/daemons/getty.c
@@ -44,12 +44,19 @@ print_banner (int fd, char *ttyname)
char *s;
struct utsname u;
char *hostname = localhost ();
+ char *t;
if (uname (&u))
u.sysname[0] = u.release[0] = '\0';
+ t = rindex (ttyname, '/');
+ if (t)
+ t++;
+ else
+ t = ttyname;
+
cc = asprintf (&s, "\r\n\n%s %s (%s) (%s)\r\n\n",
- u.sysname, u.release, hostname ?: "?", ttyname);
+ u.sysname, u.release, hostname ?: "?", t);
write (fd, s, cc);
}