summaryrefslogtreecommitdiff
path: root/dbgrid
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2008-12-04 14:33:18 -0500
committerDwight <dmerriman@gmail.com>2008-12-04 14:33:18 -0500
commit0fe5e50be0deb6790dc6789a027c821ea8eb6a81 (patch)
tree017f55c8c2d7fce68c36e49205b8c6901f123d3e /dbgrid
parent30573a6d913eb33db89ccafd6e1dbb34e901583d (diff)
downloadmongo-0fe5e50be0deb6790dc6789a027c821ea8eb6a81.tar.gz
web console work
Diffstat (limited to 'dbgrid')
-rw-r--r--dbgrid/griddatabase.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/dbgrid/griddatabase.cpp b/dbgrid/griddatabase.cpp
index af242273126..d2b89dff710 100644
--- a/dbgrid/griddatabase.cpp
+++ b/dbgrid/griddatabase.cpp
@@ -34,14 +34,15 @@ extern string dashDashGridDb;
GridDatabase::GridDatabase() { }
void GridDatabase::init() {
- char buf[256];
- int ec = gethostname(buf, 127);
- if( ec || *buf == 0 ) {
- log() << "can't get this server's hostname errno:" << ec << endl;
+ string hn = getHostName();
+ if( hn.empty() ) {
sleepsecs(5);
exit(16);
}
- ourHostname = buf;
+ ourHostname = hn;
+
+ char buf[256];
+ strcpy(buf, hn.c_str());
if( dashDashGridDb.empty() ) {
char *p = strchr(buf, '-');