[Spice-devel] [PATCH spice-server] dispatcher: Define pollfd variable only if needed

Christophe de Dinechin cdupontd at redhat.com
Mon Jun 25 11:57:30 UTC 2018



> On 25 Jun 2018, at 12:46, Frediano Ziglio <fziglio at redhat.com> wrote:
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> server/dispatcher.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server/dispatcher.c b/server/dispatcher.c
> index 301feffd..3e0decde 100644
> --- a/server/dispatcher.c
> +++ b/server/dispatcher.c
> @@ -190,13 +190,13 @@ static int read_safe(int fd, uint8_t *buf, size_t size, int block)
> {
>     int read_size = 0;
>     int ret;
> -    struct pollfd pollfd = {.fd = fd, .events = POLLIN, .revents = 0};
> 
>     if (size == 0) {
>         return 0;
>     }
> 
>     if (!block) {
> +        struct pollfd pollfd = {.fd = fd, .events = POLLIN, .revents = 0};
>         while ((ret = poll(&pollfd, 1, 0)) == -1) {
>             if (errno == EINTR) {
>                 spice_debug("EINTR in poll”);

Acked-by: Christophe de Dinechin <dinechin at redhat.com> 
> -- 
> 2.17.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel



More information about the Spice-devel mailing list