A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added round trip time contraint to the SDP program, this parameter
[simgrid.git]
/
src
/
gras
/
Virtu
/
rl_dns.c
diff --git
a/src/gras/Virtu/rl_dns.c
b/src/gras/Virtu/rl_dns.c
index
83ae30a
..
04e2f54
100644
(file)
--- a/
src/gras/Virtu/rl_dns.c
+++ b/
src/gras/Virtu/rl_dns.c
@@
-8,8
+8,7
@@
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "gras/Virtu/virtu_rl.h"
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "gras/Virtu/virtu_rl.h"
-#include <netdb.h> /* {end,set}hostent() gethostby{addr,name}() */
-
+#include "portable.h"
/* A portable DNS resolver is a nightmare to do in a portable manner.
keep it simple/stupid for now. */
/* A portable DNS resolver is a nightmare to do in a portable manner.
keep it simple/stupid for now. */
@@
-23,7
+22,8
@@
const char *gras_os_myname(void) {
myname = xbt_new(char, 255);
if (gethostname(myname, 255) == -1) {
myname = xbt_new(char, 255);
if (gethostname(myname, 255) == -1) {
- /* gethostname() failed! Trying with localhost instead.
+#ifdef HAVE_SYS_SOCKET_H
+ /* gethostname() failed! Trying with localhost instead.
We first need to query the DNS to make sure localhost is resolved
See the note in nws/Portability/dnsutil.c about {end,set}hostent() */
struct hostent *tmp;
We first need to query the DNS to make sure localhost is resolved
See the note in nws/Portability/dnsutil.c about {end,set}hostent() */
struct hostent *tmp;
@@
-37,6
+37,9
@@
const char *gras_os_myname(void) {
/* Erm. localhost cannot be resolved. There's something wrong in the user DNS setting */
sprintf(myname, "(misconfigured host)");
}
/* Erm. localhost cannot be resolved. There's something wrong in the user DNS setting */
sprintf(myname, "(misconfigured host)");
}
+#else
+ sprintf(myname, "(misconfigured windows host)");
+#endif
}
myname[254] = '\0';
}
myname[254] = '\0';