[CRIU] Re: [PATCH 3/4] restorer: Do restore futex robust lists

Cyrill Gorcunov gorcunov at openvz.org
Fri Aug 10 04:06:45 EDT 2012


On Fri, Aug 10, 2012 at 12:03:40PM +0400, Cyrill Gorcunov wrote:
> static size_t
> optional_field_get_packed_size (const ProtobufCFieldDescriptor *field,
>                                 const protobuf_c_boolean *has,
>                                 const void *member)
> {
>   if (field->type == PROTOBUF_C_TYPE_MESSAGE
>    || field->type == PROTOBUF_C_TYPE_STRING)
>     {
>       const void *ptr = * (const void * const *) member;
>       if (ptr == NULL
>        || ptr == field->default_value)
>         return 0;
>     }
>   else
>     {
>       if (!*has)
>         return 0;
>     }
>   return required_field_get_packed_size (field, member);
> }

Ouch, this is not the code snippet I've had in mind. Gimme
some time to find it in protobuf source code for proving.

	Cyrill


More information about the CRIU mailing list