namespaces: Use EINVAL instead of 22

Submitted by Radostin Stoyanov on Dec. 28, 2018, 8:10 a.m.

Details

Message ID 20181228081007.13678-1-rstoyanov1@gmail.com
State Accepted
Series "namespaces: Use EINVAL instead of 22"
Headers show

Commit Message

Radostin Stoyanov Dec. 28, 2018, 8:10 a.m.
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
---
 criu/namespaces.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
2.20.1

Patch hide | download patch | download mbox

diff --git a/criu/namespaces.c b/criu/namespaces.c
index 05d75d53..a228737e 100644
--- a/criu/namespaces.c
+++ b/criu/namespaces.c
@@ -46,7 +46,7 @@  static unsigned int join_ns_flags;

 int check_namespace_opts(void)
 {
-	errno = 22;
+	errno = EINVAL;
 	if (join_ns_flags & opts.empty_ns) {
 		pr_err("Conflicting flags: --join-ns and --empty-ns\n");
 		return -1;
@@ -71,7 +71,7 @@  static int check_int_str(char *str)
 		return 0;
 	}

-	errno = 22;
+	errno = EINVAL;
 	val = strtol(str, &endptr, 10);
 	if ((errno == ERANGE) || (endptr == str)
 			|| (*endptr != '\0')

Comments

Cyrill Gorcunov Jan. 4, 2019, 10:59 a.m.
On Fri, Dec 28, 2018 at 08:10:07AM +0000, Radostin Stoyanov wrote:
> Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Andrei Vagin Jan. 9, 2019, 6:20 a.m.
Applied, thanks!

On Fri, Dec 28, 2018 at 08:10:07AM +0000, Radostin Stoyanov wrote:
> Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
> ---
>  criu/namespaces.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/criu/namespaces.c b/criu/namespaces.c
> index 05d75d53..a228737e 100644
> --- a/criu/namespaces.c
> +++ b/criu/namespaces.c
> @@ -46,7 +46,7 @@ static unsigned int join_ns_flags;
> 
>  int check_namespace_opts(void)
>  {
> -	errno = 22;
> +	errno = EINVAL;
>  	if (join_ns_flags & opts.empty_ns) {
>  		pr_err("Conflicting flags: --join-ns and --empty-ns\n");
>  		return -1;
> @@ -71,7 +71,7 @@ static int check_int_str(char *str)
>  		return 0;
>  	}
> 
> -	errno = 22;
> +	errno = EINVAL;
>  	val = strtol(str, &endptr, 10);
>  	if ((errno == ERANGE) || (endptr == str)
>  			|| (*endptr != '\0')
> --
> 2.20.1
> 
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu