From e38b36f325153eaadd1c2a7abc5762079233e540 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 23 Jul 2008 21:29:42 -0700 Subject: flag parameters: check magic constants This patch adds test that ensure the boundary conditions for the various constants introduced in the previous patches is met. No code is generated. [akpm@linux-foundation.org: fix alpha] Signed-off-by: Ulrich Drepper Acked-by: Davide Libenzi Cc: Michael Kerrisk Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/inotify_user.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/inotify_user.c') diff --git a/fs/inotify_user.c b/fs/inotify_user.c index dc7e1f61974..fe79c25d95d 100644 --- a/fs/inotify_user.c +++ b/fs/inotify_user.c @@ -574,6 +574,10 @@ asmlinkage long sys_inotify_init1(int flags) struct file *filp; int fd, ret; + /* Check the IN_* constants for consistency. */ + BUILD_BUG_ON(IN_CLOEXEC != O_CLOEXEC); + BUILD_BUG_ON(IN_NONBLOCK != O_NONBLOCK); + if (flags & ~(IN_CLOEXEC | IN_NONBLOCK)) return -EINVAL; -- cgit v1.2.3