X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/364eee0fc6ab77fddc5437ac273527bd27711724..c2184f1318115fcea2571f738e8359044bc78d42:/src/mc/ModelChecker.cpp diff --git a/src/mc/ModelChecker.cpp b/src/mc/ModelChecker.cpp index 4c47db57f7..3ca696bef4 100644 --- a/src/mc/ModelChecker.cpp +++ b/src/mc/ModelChecker.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2017. The SimGrid Team. +/* Copyright (c) 2008-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -19,7 +19,7 @@ #include "xbt/log.h" #include "xbt/system_error.hpp" -#include "simgrid/sg_config.h" +#include "simgrid/sg_config.hpp" #include "src/mc/ModelChecker.hpp" #include "src/mc/ModelChecker.hpp" @@ -96,7 +96,7 @@ void ModelChecker::start() process_->init(); - if ((_sg_mc_dot_output_file != nullptr) && (_sg_mc_dot_output_file[0] != '\0')) + if (not _sg_mc_dot_output_file.get().empty()) MC_init_dot_output(); setup_ignore(); @@ -196,7 +196,7 @@ static void MC_report_assertion_error() bool ModelChecker::handle_message(char* buffer, ssize_t size) { - mc_message_t base_message; + s_mc_message_t base_message; if (size < (ssize_t) sizeof(base_message)) xbt_die("Broken message"); memcpy(&base_message, buffer, sizeof(base_message)); @@ -375,13 +375,8 @@ void ModelChecker::handle_waitpid() void ModelChecker::on_signal(int signo) { - switch(signo) { - case SIGCHLD: + if (signo == SIGCHLD) this->handle_waitpid(); - break; - default: - break; - } } void ModelChecker::wait_for_requests() @@ -393,7 +388,7 @@ void ModelChecker::wait_for_requests() void ModelChecker::handle_simcall(Transition const& transition) { - s_mc_message_simcall_handle m; + s_mc_message_simcall_handle_t m; memset(&m, 0, sizeof(m)); m.type = MC_MESSAGE_SIMCALL_HANDLE; m.pid = transition.pid; @@ -409,7 +404,7 @@ bool ModelChecker::checkDeadlock() int res; if ((res = this->process().getChannel().send(MC_MESSAGE_DEADLOCK_CHECK))) xbt_die("Could not check deadlock state"); - mc_message_int_t message; + s_mc_message_int_t message; ssize_t s = mc_model_checker->process().getChannel().receive(message); if (s == -1) xbt_die("Could not receive message");