[PATCH 2/5] Add an errno validation function

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

 



Signed-off-by: Dan Smith <danms@xxxxxxxxxx>
---
 include/linux/checkpoint.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/linux/checkpoint.h b/include/linux/checkpoint.h
index 2e9772e..93efa10 100644
--- a/include/linux/checkpoint.h
+++ b/include/linux/checkpoint.h
@@ -261,6 +261,11 @@ extern void *restore_sighand(struct ckpt_ctx *ctx);
 			memcpy(LIVE, SAVE, count * sizeof(*SAVE));	\
 	} while (0)
 
+static inline int ckpt_validate_errno(int errno)
+{
+	/* Current highest errno is ~530; this should provide some sanity */
+	return (errno >= 0) && (errno < 1024);
+}
 
 /* debugging flags */
 #define CKPT_DBASE	0x1		/* anything */
-- 
1.6.2.5

_______________________________________________
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