diff options
-rw-r--r-- | gethost.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } } |