X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f8cc796d4887f187e4cf49b10d53415afc56025a..ea74f5d95928a521a588737e81f1de94eef25d19:/src/mc/remote/Channel.cpp diff --git a/src/mc/remote/Channel.cpp b/src/mc/remote/Channel.cpp index cfbf71565b..43ace95034 100644 --- a/src/mc/remote/Channel.cpp +++ b/src/mc/remote/Channel.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2021. The SimGrid Team. +/* Copyright (c) 2015-2022. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -8,9 +8,10 @@ #include #include -#include +#include #include #include +#include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_Channel, mc, "MC interprocess communication"); @@ -28,8 +29,10 @@ int Channel::send(const void* message, size_t size) const { XBT_DEBUG("Send %s", to_c_str(*(MessageType*)message)); while (::send(this->socket_, message, size, 0) == -1) { - if (errno != EINTR) + if (errno != EINTR) { + XBT_ERROR("Channel::send failure: %s", strerror(errno)); return errno; + } } return 0; } @@ -39,6 +42,8 @@ ssize_t Channel::receive(void* message, size_t size, bool block) const ssize_t res = recv(this->socket_, message, size, block ? 0 : MSG_DONTWAIT); if (res != -1) XBT_DEBUG("Receive %s", to_c_str(*(MessageType*)message)); + else + XBT_ERROR("Channel::receive failure: %s", strerror(errno)); return res; } }