[CRIU] [PATCH 6/8] cr-service: set cr_errno to ENOTSUP if request is invalid

Pavel Emelyanov xemul at parallels.com
Tue Dec 2 05:33:23 PST 2014


On 12/02/2014 03:29 PM, Ruslan Kuprieiev wrote:
> Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
> ---
>  cr-service.c       | 1 +
>  include/cr-errno.h | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/cr-service.c b/cr-service.c
> index 1cc8865..75bd810 100644
> --- a/cr-service.c
> +++ b/cr-service.c
> @@ -693,6 +693,7 @@ more:
>  		break;
>  
>  	default:
> +		cr_errno = ENOTSUP;

ENOTSUP is reserved for NFSv3 :)
And EINVAL/EBADMSG are reserved in library :)
Use others.

Oh, ad update the lib/ code to report the cr_errno
back to caller somehow.

>  		send_criu_err(sk, "Invalid req");
>  		break;
>  	}
> diff --git a/include/cr-errno.h b/include/cr-errno.h
> index ff3f06c..09292e4 100644
> --- a/include/cr-errno.h
> +++ b/include/cr-errno.h
> @@ -6,6 +6,7 @@ extern int cr_errno;
>   * ESRCH	- no process can be found corresponding to that specified by pid
>   * EEXIST	- process with such pid already exists
>   * EBADRQC	- bad options
> + * ENOTSUP	- invalid request
>   */
>  
>  #endif /* __CR_ERRNO_H__ */
> 



More information about the CRIU mailing list