diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-26 11:48:49 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-26 11:48:49 -0400 |
commit | c3cc99ff5d24e2eeaf7ec2032e720681916990e3 (patch) | |
tree | c3e74171bbbd2adde9d60b9db1c440415c8d2831 /fs/timerfd.c | |
parent | 38ffbe66d59051fd9cfcfc8545f164700e2fa3bc (diff) | |
parent | 024e8ac04453b3525448c31ef39848cf675ba6db (diff) |
Merge branch 'linus' into x86/xen
Diffstat (limited to 'fs/timerfd.c')
-rw-r--r-- | fs/timerfd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/timerfd.c b/fs/timerfd.c index d87d354ec424..c502c60e4f54 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c | |||
@@ -184,7 +184,11 @@ asmlinkage long sys_timerfd_create(int clockid, int flags) | |||
184 | int ufd; | 184 | int ufd; |
185 | struct timerfd_ctx *ctx; | 185 | struct timerfd_ctx *ctx; |
186 | 186 | ||
187 | if (flags) | 187 | /* Check the TFD_* constants for consistency. */ |
188 | BUILD_BUG_ON(TFD_CLOEXEC != O_CLOEXEC); | ||
189 | BUILD_BUG_ON(TFD_NONBLOCK != O_NONBLOCK); | ||
190 | |||
191 | if (flags & ~(TFD_CLOEXEC | TFD_NONBLOCK)) | ||
188 | return -EINVAL; | 192 | return -EINVAL; |
189 | if (clockid != CLOCK_MONOTONIC && | 193 | if (clockid != CLOCK_MONOTONIC && |
190 | clockid != CLOCK_REALTIME) | 194 | clockid != CLOCK_REALTIME) |
@@ -198,7 +202,8 @@ asmlinkage long sys_timerfd_create(int clockid, int flags) | |||
198 | ctx->clockid = clockid; | 202 | ctx->clockid = clockid; |
199 | hrtimer_init(&ctx->tmr, clockid, HRTIMER_MODE_ABS); | 203 | hrtimer_init(&ctx->tmr, clockid, HRTIMER_MODE_ABS); |
200 | 204 | ||
201 | ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx); | 205 | ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx, |
206 | flags & (O_CLOEXEC | O_NONBLOCK)); | ||
202 | if (ufd < 0) | 207 | if (ufd < 0) |
203 | kfree(ctx); | 208 | kfree(ctx); |
204 | 209 | ||