[RFC][PATCH 4/5] XResource extension v1.2 implementation of XResQueryClientIds

Rami Ylimäki rami.ylimaki at vincit.fi
Fri Dec 3 07:15:30 PST 2010


On 12/03/2010 12:44 PM, Erkki Seppälä wrote:
>   static XEXT_GENERATE_FIND_DISPLAY (find_display, xres_ext_info,
> -                                   xres_extension_name,
> +                                   xres_extension_name,
>                                      &xres_extension_hooks,
>                                      0, NULL)
>
> @@ -189,7 +189,7 @@ Status XResQueryClientResources (
>               _XEatData(dpy, rep.length<<  2);
>           }
>       }
> -
> +
>       UnlockDisplay (dpy);
>       SyncHandle ();
>       return result;

Let's clean the dummy changes from the patch.

> +static Bool ReadClientValues(
> +   Display              *dpy,
> +   long                 num_ids,
> +   XResClientIdValue   *client_ids /* out */
> +)
> +{
> +    int c;
> +    for (c = 0; c<  num_ids; ++c) {
> +        XResClientIdValue* client = client_ids + c;
> +        _XRead32 (dpy,&client->spec.client, 4);
> +        _XRead32 (dpy,&client->spec.mask, 4);
> +        _XRead32 (dpy,&client->length, 4);
> +        client->value = malloc(client->length);
> +        _XRead32 (dpy, client->value, client->length);
> +    }
> +    return True;
> +}

Check if memory allocation failed.

-- Rami



More information about the xorg-devel mailing list