[Spice-devel] [spice-gtk v3 4/6] spice_channel_read_wire: move variables to internal scope

Christophe Fergeau cfergeau at redhat.com
Thu Mar 2 14:18:59 UTC 2017


Acked-by: Christophe Fergeau <cfergeau at redhat.com>

On Tue, Feb 28, 2017 at 12:21:49PM +0100, Victor Toso wrote:
> From: Victor Toso <me at victortoso.com>
> 
> And avoid single line if plus comment
> 
> Signed-off-by: Victor Toso <victortoso at redhat.com>
> ---
>  src/spice-channel.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/src/spice-channel.c b/src/spice-channel.c
> index f2d1b8a..c2e8a01 100644
> --- a/src/spice-channel.c
> +++ b/src/spice-channel.c
> @@ -1048,12 +1048,15 @@ static int spice_channel_read_wire_nonblocking(SpiceChannel *channel,
>  static int spice_channel_read_wire(SpiceChannel *channel, void *data, size_t len)
>  {
>      SpiceChannelPrivate *c = channel->priv;
> -    GIOCondition cond;
> -    gssize ret;
>  
>      while (TRUE) {
> +        gssize ret;
> +        GIOCondition cond;
>  
> -        if (c->has_error) return 0; /* has_error is set by disconnect(), return no error */
> +        if (c->has_error) {
> +            /* has_error is set by disconnect(), return no error */
> +            return 0;
> +        }
>  
>          ret = spice_channel_read_wire_nonblocking(channel, data, len, &cond);
>  
> -- 
> 2.9.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170302/6c0287ce/attachment.sig>


More information about the Spice-devel mailing list