X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=fs%2Fsignalfd.c;h=9c39bc7f843137cf167476797554697ce5834da5;hb=b7d39aff91454f2534db2275f55908656ec0470c;hp=c8609fa51a130daad2baef38a0fe2584790b625a;hpb=9deb27baedb79759c3ab9435a7d8b841842d56e9;p=linux-2.6-omap-h63xx.git diff --git a/fs/signalfd.c b/fs/signalfd.c index c8609fa51a1..9c39bc7f843 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c @@ -211,7 +211,11 @@ asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask, sigset_t sigmask; struct signalfd_ctx *ctx; - if (flags & ~SFD_CLOEXEC) + /* Check the SFD_* constants for consistency. */ + BUILD_BUG_ON(SFD_CLOEXEC != O_CLOEXEC); + BUILD_BUG_ON(SFD_NONBLOCK != O_NONBLOCK); + + if (flags & ~(SFD_CLOEXEC | SFD_NONBLOCK)) return -EINVAL; if (sizemask != sizeof(sigset_t) || @@ -232,7 +236,7 @@ asmlinkage long sys_signalfd4(int ufd, sigset_t __user *user_mask, * anon_inode_getfd() will install the fd. */ ufd = anon_inode_getfd("[signalfd]", &signalfd_fops, ctx, - flags & O_CLOEXEC); + flags & (O_CLOEXEC | O_NONBLOCK)); if (ufd < 0) kfree(ctx); } else {