summaryrefslogtreecommitdiff
blob: 34685b942b9be15e28f5ed954efb552e1149754a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From 7ade2254048dccfde13846c3e0a13b7f5acbef36 Mon Sep 17 00:00:00 2001
From: Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
Date: Tue, 21 May 2019 18:41:09 +0200
Subject: [PATCH 13/19] no need for working DNS in idl compiler

---
 idl/main.cc    | 7 +++++++
 orb/address.cc | 7 +++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/idl/main.cc b/idl/main.cc
index a2ad803..61dcdaa 100644
--- a/idl/main.cc
+++ b/idl/main.cc
@@ -75,6 +75,13 @@ int main( int argc, char *argv[] )
   DB db;
 
   // ORB initialization
+  // Resolving the hostname is useless in the IDL compiler.
+  vector<char*> argvv;
+  argvv.push_back(argv[0]);
+  argvv.push_back(strdup("-ORBNoResolve"));
+  argvv.insert(argvv.end(), &argv[1], &argv[argc]);
+  ++argc;
+  argv = &argvv.front();
   CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
 
 #ifdef _WIN32
diff --git a/orb/address.cc b/orb/address.cc
index 05ddf8b..e762e46 100644
--- a/orb/address.cc
+++ b/orb/address.cc
@@ -635,8 +635,11 @@ MICO::InetAddress::hostname ()
 {
     if (hname.length() == 0) {
         char buf[200];
-        int r = gethostname (buf, 200);
-	assert (r == 0);
+	if (_resolve) {
+	    int r = gethostname (buf, 200);
+	    assert (r == 0);
+	} else
+	    strcpy(buf, "localhost");
         /*
          * some OSes do not return an FQDN. So we get the ip address for the
          * hostname and resolve that address into the FQDN...
-- 
2.19.2