Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove duplicate error message, and use xbt_assert.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 24 Oct 2019 12:23:27 +0000 (14:23 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 24 Oct 2019 20:39:07 +0000 (22:39 +0200)
src/mc/remote/RemoteClient.cpp

index 3f65ed5..72840d0 100644 (file)
@@ -407,14 +407,9 @@ std::string RemoteClient::read_string(RemotePtr<char> address) const
 
   while (1) {
     ssize_t c = pread(this->memory_file, res.data() + off, res.size() - off, (off_t)address.address() + off);
 
   while (1) {
     ssize_t c = pread(this->memory_file, res.data() + off, res.size() - off, (off_t)address.address() + off);
-    if (c == -1) {
-      if (errno == EINTR)
-        continue;
-      else
-        xbt_die("Could not read from from remote process");
-    }
-    if (c == 0)
-      xbt_die("Could not read string from remote process");
+    if (c == -1 && errno == EINTR)
+      continue;
+    xbt_assert(c > 0, "Could not read string from remote process");
 
     void* p = memchr(res.data() + off, '\0', c);
     if (p)
 
     void* p = memchr(res.data() + off, '\0', c);
     if (p)