Only list sockets in session list

This commit is contained in:
Marc André Tanner 2014-06-30 15:02:00 +02:00
parent b8b76171e8
commit 7b95d5b65e
1 changed files with 1 additions and 1 deletions

View File

@ -447,7 +447,7 @@ static int list_session() {
puts("Active sessions");
while (n--) {
struct stat sb; char buf[255];
if (stat(namelist[n]->d_name, &sb) == 0) {
if (stat(namelist[n]->d_name, &sb) == 0 && S_ISSOCK(sb.st_mode)) {
strftime(buf, sizeof(buf), "%a%t %F %T", localtime(&sb.st_atime));
char status = ' ';
if (sb.st_mode & S_IXUSR)