From a9b89eadf4709b8cba4202ec8e7797d6152d1c69 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 3 Mar 2015 14:15:51 +0100 Subject: [PATCH 05/12] =?UTF-8?q?Fix=20warning=20'conversion=20to=20?= =?UTF-8?q?=E2=80=98long=20unsigned=20int=E2=80=99=20from=20=E2=80=98Write?= =?UTF-8?q?Result=E2=80=99=20may=20change=20the=20sign=20of=20the=20result?= =?UTF-8?q?=20[-Wsign-conversion]'.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89284 --- tools/tool-common.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/tool-common.c b/tools/tool-common.c index ee5099d..e3526cd 100644 --- a/tools/tool-common.c +++ b/tools/tool-common.c @@ -80,18 +80,21 @@ tool_write_all (int fd, while (size > bytes_written) { - WriteResult this_time = write (fd, p, size - bytes_written); + WriteResult res = write (fd, p, size - bytes_written); - if (this_time < 0) + if (res < 0) { if (errno == EINTR) continue; else return FALSE; } - - p += this_time; - bytes_written += this_time; + else + { + size_t this_time = (size_t) res; + p += this_time; + bytes_written += this_time; + } } return TRUE; -- 1.8.4.5