Change to g_warning() into assertions in GOutputStream

These would only happen if the API contract of the write() and writev()
functions was broken by subclasses.
This commit is contained in:
Sebastian Dröge 2019-01-04 13:00:34 +02:00
parent 0bcc177378
commit 89da9eb6c0

View File

@ -306,9 +306,7 @@ g_output_stream_write_all (GOutputStream *stream,
*bytes_written = _bytes_written; *bytes_written = _bytes_written;
return FALSE; return FALSE;
} }
g_return_val_if_fail (res > 0, FALSE);
if (res == 0)
g_warning ("Write returned zero without error");
_bytes_written += res; _bytes_written += res;
} }
@ -492,8 +490,7 @@ g_output_stream_writev_all (GOutputStream *stream,
return FALSE; return FALSE;
} }
if (n_written == 0) g_return_val_if_fail (n_written > 0, FALSE);
g_warning ("Write returned zero without error");
_bytes_written += n_written; _bytes_written += n_written;
/* skip vectors that have been written in full */ /* skip vectors that have been written in full */