summaryrefslogtreecommitdiffstats
path: root/fs/timerfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/timerfd.c')
-rw-r--r--fs/timerfd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/timerfd.c b/fs/timerfd.c
index 77c2bc9..c6ef5e3 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -184,7 +184,7 @@ asmlinkage long sys_timerfd_create(int clockid, int flags)
int ufd;
struct timerfd_ctx *ctx;
- if (flags)
+ if (flags & ~TFD_CLOEXEC)
return -EINVAL;
if (clockid != CLOCK_MONOTONIC &&
clockid != CLOCK_REALTIME)
@@ -198,7 +198,8 @@ asmlinkage long sys_timerfd_create(int clockid, int flags)
ctx->clockid = clockid;
hrtimer_init(&ctx->tmr, clockid, HRTIMER_MODE_ABS);
- ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx, 0);
+ ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx,
+ flags & O_CLOEXEC);
if (ufd < 0)
kfree(ctx);
OpenPOWER on IntegriCloud