Re: [PATCH 1/5] Add an errno validation function (v2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Dan Smith (danms@xxxxxxxxxx):
> Signed-off-by: Dan Smith <danms@xxxxxxxxxx>
> 
> Changes in v2:
>   - Compare against MAX_ERRNO instead of more stringent but obscure
>     constant
> ---
>  include/linux/checkpoint.h |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/checkpoint.h b/include/linux/checkpoint.h
> index 60d1116..b2c86a3 100644
> --- a/include/linux/checkpoint.h
> +++ b/include/linux/checkpoint.h
> @@ -28,7 +28,7 @@
>  #include <linux/user_namespace.h>
>  #include <linux/checkpoint_types.h>
>  #include <linux/checkpoint_hdr.h>
> -
> +#include <linux/err.h>
> 
>  /* ckpt_ctx: kflags */
>  #define CKPT_CTX_CHECKPOINT_BIT		0
> @@ -257,6 +257,10 @@ extern void *restore_sighand(struct ckpt_ctx *ctx);
>  			memcpy(LIVE, SAVE, count * sizeof(*SAVE));	\
>  	} while (0)
> 
> +static inline int ckpt_validate_errno(int errno)
> +{
> +	return (errno >= 0) && (errno < MAX_ERRNO);
> +}

Maybe i should take a break and re-read in a few minutes, but
don't you want this to be:

	return (errno > 0) && (errno <= MAX_ERRNO));
> 
>  /* debugging flags */
>  #define CKPT_DBASE	0x1		/* anything */
> -- 
> 1.6.2.5
> 
> _______________________________________________
> Containers mailing list
> Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
> https://lists.linux-foundation.org/mailman/listinfo/containers
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux