From eb3793731d1cf78189d20daeb5fdf0e97a4bb587 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Sun, 22 Nov 2020 15:14:02 +0100 Subject: [PATCH] Use ssize_t. --- src/smpi/internals/smpi_global.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index ba46a4b432..a8798fd5d2 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -379,13 +379,13 @@ static void smpi_copy_file(const std::string& src, const std::string& target, of #endif // If this point is reached, sendfile() actually is not available. Copy file by hand. std::vector buf(1024 * 1024 * 4); - while (int got = read(fdin, buf.data(), buf.size())) { + while (ssize_t got = read(fdin, buf.data(), buf.size())) { if (got == -1) { xbt_assert(errno == EINTR, "Cannot read from %s", src.c_str()); } else { const unsigned char* p = buf.data(); - int todo = got; - while (int done = write(fdout, p, todo)) { + ssize_t todo = got; + while (ssize_t done = write(fdout, p, todo)) { if (done == -1) { xbt_assert(errno == EINTR, "Cannot write into %s", target.c_str()); } else { -- 2.20.1