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 <drepper@redhat.com> Acked-by: Davide Libenzi <davidel@xmailserver.org> Cc: Michael Kerrisk <mtk.manpages@googlemail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
510df2dd48
commit
e38b36f325
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user