|
@@ -184,7 +184,7 @@ asmlinkage long sys_timerfd_create(int clockid, int flags)
|
|
int ufd;
|
|
int ufd;
|
|
struct timerfd_ctx *ctx;
|
|
struct timerfd_ctx *ctx;
|
|
|
|
|
|
- if (flags & ~TFD_CLOEXEC)
|
|
|
|
|
|
+ if (flags & ~(TFD_CLOEXEC | TFD_NONBLOCK))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
if (clockid != CLOCK_MONOTONIC &&
|
|
if (clockid != CLOCK_MONOTONIC &&
|
|
clockid != CLOCK_REALTIME)
|
|
clockid != CLOCK_REALTIME)
|
|
@@ -199,7 +199,7 @@ asmlinkage long sys_timerfd_create(int clockid, int flags)
|
|
hrtimer_init(&ctx->tmr, clockid, HRTIMER_MODE_ABS);
|
|
hrtimer_init(&ctx->tmr, clockid, HRTIMER_MODE_ABS);
|
|
|
|
|
|
ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx,
|
|
ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx,
|
|
- flags & O_CLOEXEC);
|
|
|
|
|
|
+ flags & (O_CLOEXEC | O_NONBLOCK));
|
|
if (ufd < 0)
|
|
if (ufd < 0)
|
|
kfree(ctx);
|
|
kfree(ctx);
|
|
|
|
|