blob: 4c35a44d975afcd2a37d86d2817644304b5be507 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
--- a/skkserv/skkserv.c
+++ b/skkserv/skkserv.c
@@ -723,7 +723,11 @@
fprintf(errout, "%s:cannot get hostname, or too long hostname\n", pgmnm);
exit(1);
}
- hentry = gethostbyname(hname);
+ if ((hentry = gethostbyname(hname)) == NULL
+ && (hentry = gethostbyname("localhost")) == NULL) {
+ perror("gethostbyname");
+ exit(1);
+ }
#ifdef NO_ADDR_LIST
strcat(hname, ":");
strcat(hname, hentry->h_addr);
|