null+****@clear*****
null+****@clear*****
2011年 12月 1日 (木) 22:16:17 JST
Kouhei Sutou 2011-12-01 13:16:17 +0000 (Thu, 01 Dec 2011)
New Revision: 8fd6938ed6f4316e4e696dfacdceddce0ec0d5d6
Log:
use "localhost" instead of hostname as fallback default hostname.
If hostname can't be resolved, groonga exits
abnormally. It's not suitable for the default behavior.
Reported by @uzulla. Thanks!!!
Modified files:
src/groonga.c
Modified: src/groonga.c (+3 -0)
===================================================================
--- src/groonga.c 2011-12-01 07:21:04 +0000 (2ed1d20)
+++ src/groonga.c 2011-12-01 13:16:17 +0000 (6ec14dd)
@@ -2356,6 +2356,9 @@ main(int argc, char **argv)
}
} else {
gethostname(hostname, HOST_NAME_MAX);
+ if (!gethostbyname(hostname)) {
+ strcpy(hostname, "localhost");
+ }
}
if (cache_limitstr) {
uint32_t max, *max_nentries;