Re: [PATCH spice-gtk] webdav: check g_output_stream_write_all() return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2015-05-06 at 17:59 +0200, Marc-André Lureau wrote:
> Check g_output_stream_write_all() return value to silence a coverity
> CHECKED_RETURN warning
> ---
>  gtk/channel-webdav.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/gtk/channel-webdav.c b/gtk/channel-webdav.c
> index 95c0521..1d3862e 100644
> --- a/gtk/channel-webdav.c
> +++ b/gtk/channel-webdav.c
> @@ -147,8 +147,7 @@ static gboolean output_queue_idle(gpointer 
> user_data)
>          return FALSE;
>      }
>  
> -    g_output_stream_write_all(q->output, e->buf, e->size, NULL, 
> NULL, &error);
> -    if (error)
> +    if (!g_output_stream_write_all(q->output, e->buf, e->size, 
> NULL, NULL, &error))
>          goto err;
>      else if (e->pushed_cb)
>          e->pushed_cb(q, e->user_data);
> @@ -159,7 +158,9 @@ static gboolean output_queue_idle(gpointer 
> user_data)
>      return TRUE;
>  
>  err:
> -    g_warning("error: %s", error->message);
> +    g_warning("failed to write to output stream");
> +    if (error)
> +        g_warning("error: %s", error->message);
>      g_clear_error(&error);
>  
>      q->idle_id = 0;

ack.

Pavel
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]