From: alegrand Date: Tue, 29 Mar 2005 23:43:29 +0000 (+0000) Subject: Avoid segfault or infinite loop when calling this function from somewhere else than... X-Git-Tag: v3.3~4168 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5b2cf57955a81760994147720504339413d91aa9 Avoid segfault or infinite loop when calling this function from somewhere else than a MSG process... git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1186 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/gras/Virtu/sg_dns.c b/src/gras/Virtu/sg_dns.c index 1d67ee49ae..0f7cfa927f 100644 --- a/src/gras/Virtu/sg_dns.c +++ b/src/gras/Virtu/sg_dns.c @@ -11,5 +11,9 @@ #include "gras/Virtu/virtu_sg.h" const char *gras_os_myname(void) { + m_process_t process = MSG_process_self(); + if ((process != NULL) && (process->simdata)) return MSG_host_get_name(MSG_host_self()); + else + return ""; }