]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Fix warning 'conversion to ‘long unsigned int’ from ‘WriteResult’ may change the...
authorRalf Habacker <ralf.habacker@freenet.de>
Tue, 3 Mar 2015 13:15:51 +0000 (14:15 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Wed, 4 Mar 2015 11:33:12 +0000 (12:33 +0100)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89284
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
tools/tool-common.c

index 497a50978464d4ed73fce5150f05784313a8d80c..b1f3650290bb25a0325c0f35439409e913faa635 100644 (file)
@@ -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;