summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gethost.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gethost.c b/gethost.c
index 8cb58c5..c353a9a 100644
--- a/gethost.c
+++ b/gethost.c
@@ -202,14 +202,14 @@ struct addrlist *get_address_info (
strncpy(path, fulldpyname, sizeof(path));
path[sizeof(path) - 1] = '\0';
#endif
- if (0 == stat(path, &sbuf)) {
+ if (0 == stat(path, &sbuf) && S_ISSOCK(sbuf.st_mode) ) {
is_path_to_socket = 1;
} 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)) {
is_path_to_socket = 1;
}
}