[CRIU] [PATCH v4 21/33] files: Add open stages enum

Pavel Emelyanov xemul at virtuozzo.com
Tue Dec 20 07:40:00 PST 2016


On 12/13/2016 06:07 PM, Kirill Tkhai wrote:
> This will be used in next patches.

After applying the whole set and looking at the result, I see that
ORV_ (btw, what does it mean?) constants are used together with
plain 0s and -1s.

So my proposal is -- let's chose either of:

- use 0, 1 and -1 explicitly
- use ORV_ __everywhere__
- use plain 0 and -1 for OK and ERROR and only ORV_AGAIN as named constant

-- Pavel

> Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
> ---
>  criu/include/files.h |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/criu/include/files.h b/criu/include/files.h
> index 9fec16a..83f1cae 100644
> --- a/criu/include/files.h
> +++ b/criu/include/files.h
> @@ -97,6 +97,12 @@ static inline int fdinfo_rst_prio(struct fdinfo_list_entry *fd_a, struct fdinfo_
>  		((fd_a->pid == fd_b->pid) && (fd_a->fe->fd < fd_b->fe->fd));
>  }
>  
> +enum {
> +	ORV_ERR = -1,
> +	ORV_OK,
> +	ORV_AGAIN,
> +};
> +
>  struct file_desc_ops {
>  	/* fd_types from images/fdinfo.proto */
>  	unsigned int		type;
> 
> .
> 



More information about the CRIU mailing list