mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-02 02:40:07 +02:00
Correct the error handling in splice_stream_with_progress
We need to get out of both loops, so a simple 'break' doesn't cut it. Bugs 613748 and 613923
This commit is contained in:
parent
409a3a61ec
commit
6e77ee0971
@ -2826,10 +2826,10 @@ splice_stream_with_progress (GInputStream *in,
|
|||||||
while (n_read > 0)
|
while (n_read > 0)
|
||||||
{
|
{
|
||||||
if (g_cancellable_set_error_if_cancelled (cancellable, error))
|
if (g_cancellable_set_error_if_cancelled (cancellable, error))
|
||||||
break;
|
goto out;
|
||||||
|
|
||||||
if (!do_splice (buffer[0], NULL, fd_out, &offset_out, n_read, &n_written, error))
|
if (!do_splice (buffer[0], NULL, fd_out, &offset_out, n_read, &n_written, error))
|
||||||
break;
|
goto out;
|
||||||
|
|
||||||
n_read -= n_written;
|
n_read -= n_written;
|
||||||
}
|
}
|
||||||
@ -2842,6 +2842,7 @@ splice_stream_with_progress (GInputStream *in,
|
|||||||
if (progress_callback)
|
if (progress_callback)
|
||||||
progress_callback (offset_in, total_size, progress_callback_data);
|
progress_callback (offset_in, total_size, progress_callback_data);
|
||||||
|
|
||||||
|
out:
|
||||||
close (buffer[0]);
|
close (buffer[0]);
|
||||||
close (buffer[1]);
|
close (buffer[1]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user