mirror of https://github.com/martanne/abduco
Do not display hostname suffix in session listing
Trying to attach to an existing session with its hostname does not work, therefore avoid confusion and do not display it.
This commit is contained in:
parent
b2f2dc810d
commit
ef36456177
5
abduco.c
5
abduco.c
|
|
@ -448,7 +448,7 @@ static int list_session() {
|
|||
int n = scandir(sockaddr.sun_path, &namelist, session_filter, session_comparator);
|
||||
if (n < 0)
|
||||
return 1;
|
||||
puts("Active sessions");
|
||||
printf("Active sessions (on host %s)\n", server.host+1);
|
||||
while (n--) {
|
||||
struct stat sb; char buf[255];
|
||||
if (stat(namelist[n]->d_name, &sb) == 0 && S_ISSOCK(sb.st_mode)) {
|
||||
|
|
@ -458,6 +458,9 @@ static int list_session() {
|
|||
status = '*';
|
||||
else if (sb.st_mode & S_IXGRP)
|
||||
status = '+';
|
||||
char *name = strstr(namelist[n]->d_name, server.host);
|
||||
if (name)
|
||||
*name = '\0';
|
||||
printf("%c %s\t%s\n", status, buf, namelist[n]->d_name);
|
||||
}
|
||||
free(namelist[n]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue