[PATCH 2/5] Add an errno validation function

Dan Smith danms at us.ibm.com
Wed Jul 22 13:41:38 PDT 2009


Signed-off-by: Dan Smith <danms at us.ibm.com>
---
 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



More information about the Containers mailing list