Commit 89da9eb6 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

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.
parent 0bcc1773
......@@ -306,9 +306,7 @@ g_output_stream_write_all (GOutputStream *stream,
*bytes_written = _bytes_written;
return FALSE;
}
if (res == 0)
g_warning ("Write returned zero without error");
g_return_val_if_fail (res > 0, FALSE);
_bytes_written += res;
}
......@@ -492,8 +490,7 @@ g_output_stream_writev_all (GOutputStream *stream,
return FALSE;
}
if (n_written == 0)
g_warning ("Write returned zero without error");
g_return_val_if_fail (n_written > 0, FALSE);
_bytes_written += n_written;
/* skip vectors that have been written in full */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment