Commit ce87ae39 authored by Larry Doolittle's avatar Larry Doolittle
Browse files

Expand checks of socket file with S_ISSOCK

Extend work done in commit 18a3c3a7 to earlier in the socket detection process
Fixes issue #6.
parent 83e97b2b
Pipeline #564099 passed with stages
in 1 minute and 33 seconds
......@@ -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;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment