diff options
Diffstat (limited to 'daemons')
-rw-r--r-- | daemons/getty.c | 9 |
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); } |