summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2015-03-03 14:15:51 +0100
committerRalf Habacker <ralf.habacker@freenet.de>2015-03-04 12:33:12 +0100
commit6588c65708d7f64bb3547f75689f105efadd58e3 (patch)
tree221e83d3380b3ccd4c5d44a61eabd624ca7c725a /tools
parent72549f316fb952a3e2e4631864191a835a9251e7 (diff)
downloaddbus-6588c65708d7f64bb3547f75689f105efadd58e3.tar.gz
Fix warning 'conversion to ‘long unsigned int’ from ‘WriteResult’ may change the sign of the result [-Wsign-conversion]'.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89284 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/tool-common.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/tool-common.c b/tools/tool-common.c
index 497a5097..b1f36502 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;