[CRIU] [PATCH 4/8] parasite: Add missing 'void' in function declarations

Cyrill Gorcunov gorcunov at openvz.org
Wed Feb 22 05:12:15 EST 2012


On Wed, Feb 22, 2012 at 02:03:43PM +0400, Stanislav Kinsbursky wrote:
> 22.02.2012 13:35, Cyrill Gorcunov пишет:
> >On Wed, Feb 22, 2012 at 01:32:19PM +0400, Stanislav Kinsbursky wrote:
> >>
> >>Ok. remove your SET_PARASITE_STATUS_SUCCESS then and make it even easier.
> >>Let's there will be only one place, where SET_PARASITE_STATUS is
> >>called - parasite_service().
> >
> >I think this is good idea! Mind to provide an example how it might
> >look like? Some opencoded case, not diff. Then we could estimate
> >the result.
> >
> >	Cyrill
> 
> Something like below:
> 
> #define SET_PARASITE_STATUS(st, ret_code, sys_ret_code) \
>         do {                                            \
>                 (st)->ret       = ret_code,             \
>                 (st)->sys_ret   = sys_ret_code & -1,    \
>                 (st)->line      = sys_ret_code >> 32;   \
>         } while (0)
> 
> 
> int handle_command_A(void *data, long *sys_ret_code);
> {
> 	int err;
> 
> 	err = some_action(data);
> 	if (err)
> 		*sys_ret_code = __LINE__ << 32 | err;
> 		return -1;
> 	}
> 	return 0;
> }
> 

Stas, you must *not* "OR" with negative value without
stripping of a sign extension. Other than that -- the
approach make sense to me. I'm waiting for comments
from others in criu dev camp.

	Cyrill


More information about the CRIU mailing list