git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1354
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
* 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 <unistd.h> /* gethostname */
/* 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. */
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;
/* 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