diff options
author | Damien Miller <djm@mindrot.org> | 2003-01-10 09:53:12 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2003-01-10 09:53:12 +1100 |
commit | a8ed44b79e6dd78d7871b0fb8149951b54662ef5 (patch) | |
tree | cca59d396ec59133ec1c42536eca25d087dcfcc7 /session.c | |
parent | 13b2e55c36ec316bd4ec15e830c9eae888d2cb68 (diff) | |
download | openssh-git-a8ed44b79e6dd78d7871b0fb8149951b54662ef5.tar.gz |
- (djm) Enable new setproctitle emulation for Linux, AIX and HP/UX. More
systems may be added later.
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -2002,13 +2002,22 @@ session_tty_list(void) { static char buf[1024]; int i; + char *cp; + buf[0] = '\0'; for (i = 0; i < MAX_SESSIONS; i++) { Session *s = &sessions[i]; if (s->used && s->ttyfd != -1) { + + if (strncmp(s->tty, "/dev/", 5) != 0) { + cp = strrchr(s->tty, '/'); + cp = (cp == NULL) ? s->tty : cp + 1; + } else + cp = s->tty + 5; + if (buf[0] != '\0') strlcat(buf, ",", sizeof buf); - strlcat(buf, strrchr(s->tty, '/') + 1, sizeof buf); + strlcat(buf, cp, sizeof buf); } } if (buf[0] == '\0') |