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
Host may be null (fix crash with logs).
[simgrid.git]
/
src
/
s4u
/
s4u_Host.cpp
diff --git
a/src/s4u/s4u_Host.cpp
b/src/s4u/s4u_Host.cpp
index
73195c5
..
5022080
100644
(file)
--- a/
src/s4u/s4u_Host.cpp
+++ b/
src/s4u/s4u_Host.cpp
@@
-660,7
+660,13
@@
sg_host_t sg_host_self()
/* needs to be public and without simcall for exceptions and logging events */
const char* sg_host_self_get_name()
{
/* needs to be public and without simcall for exceptions and logging events */
const char* sg_host_self_get_name()
{
- return SIMIX_is_maestro() ? "" : simgrid::kernel::actor::ActorImpl::self()->get_host()->get_cname();
+ const char* res = "";
+ if (not SIMIX_is_maestro()) {
+ simgrid::s4u::Host* host = simgrid::kernel::actor::ActorImpl::self()->get_host();
+ if (host != nullptr)
+ res = host->get_cname();
+ }
+ return res;
}
double sg_host_load(sg_host_t host)
}
double sg_host_load(sg_host_t host)