[Spice-devel] [PATCH] remove a warning building a test

Christophe Fergeau cfergeau at redhat.com
Tue May 17 15:16:38 UTC 2016


Would be nice to have the warning in the commit log :)

Christophe

On Mon, May 16, 2016 at 05:13:11PM +0100, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/tests/stream-test.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/server/tests/stream-test.c b/server/tests/stream-test.c
> index 6317796..8fd1449 100644
> --- a/server/tests/stream-test.c
> +++ b/server/tests/stream-test.c
> @@ -35,6 +35,7 @@ sock_fd_read(int sock, void *buf, ssize_t bufsize, int *fd)
>              char control[CMSG_SPACE(sizeof (int))];
>          } cmsgu;
>          struct cmsghdr *cmsg;
> +        int i;
>  
>          iov.iov_base = buf;
>          iov.iov_len = bufsize;
> @@ -63,7 +64,8 @@ sock_fd_read(int sock, void *buf, ssize_t bufsize, int *fd)
>                  exit(1);
>              }
>  
> -            *fd = *((int *) CMSG_DATA(cmsg));
> +            memcpy(&i, CMSG_DATA(cmsg), sizeof(i));
> +            *fd = i;
>          } else
>              *fd = -1;
>      } else {
> -- 
> 2.7.4
> 
> _______________________________________________
> 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: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160517/b401473d/attachment.sig>


More information about the Spice-devel mailing list