diff options
author | Larry Doolittle <larry@doolittle.boa.org> | 2022-04-16 15:28:31 -0700 |
---|---|---|
committer | Larry Doolittle <larry@doolittle.boa.org> | 2022-04-16 15:28:31 -0700 |
commit | ce87ae39d5ab28733b4125a09d0a643d1581b1c8 (patch) | |
tree | f7b5f20a29e78d213f600893b59c3a1c023b0659 /parsedpy.c | |
parent | 83e97b2bf683f341da177bd5df5b1297cbdc16a4 (diff) |
Expand checks of socket file with S_ISSOCK
Extend work done in commit 18a3c3a to earlier in the socket detection process
Fixes issue #6.
Diffstat (limited to 'parsedpy.c')
-rw-r--r-- | parsedpy.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -175,14 +175,14 @@ parse_displayname (const char *displayname, strncpy(path, displayname, sizeof(path) - 1); path[sizeof(path) - 1] = '\0'; #endif - if (0 == stat(path, &sbuf)) { + if (0 == stat(path, &sbuf) && S_ISSOCK(sbuf.st_mode)) { family = FamilyLocal; } else { char *dot = strrchr(path, '.'); if (dot) { *dot = '\0'; /* screen = atoi(dot + 1); */ - if (0 == stat(path, &sbuf)) { + if (0 == stat(path, &sbuf) && S_ISSOCK(sbuf.st_mode)) { family = FamilyLocal; } } |