Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89284
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
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;