Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105424
b: refs/heads/master
c: e7d476d
h: refs/heads/master
v: v3
  • Loading branch information
Ulrich Drepper authored and Linus Torvalds committed Jul 24, 2008
1 parent 0e3e7b4 commit a0fbf61
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5fb5e04926a54bc1c22bba7ca166840f4476196f
refs/heads/master: e7d476dfdf0bcfed478a207aecfdc84f81efecaf
4 changes: 2 additions & 2 deletions trunk/fs/eventfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ asmlinkage long sys_eventfd2(unsigned int count, int flags)
int fd;
struct eventfd_ctx *ctx;

if (flags & ~EFD_CLOEXEC)
if (flags & ~(EFD_CLOEXEC | EFD_NONBLOCK))
return -EINVAL;

ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
Expand All @@ -218,7 +218,7 @@ asmlinkage long sys_eventfd2(unsigned int count, int flags)
* anon_inode_getfd() will install the fd.
*/
fd = anon_inode_getfd("[eventfd]", &eventfd_fops, ctx,
flags & O_CLOEXEC);
flags & (O_CLOEXEC | O_NONBLOCK));
if (fd < 0)
kfree(ctx);
return fd;
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/eventfd.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@

#ifdef CONFIG_EVENTFD

/* For O_CLOEXEC */
/* For O_CLOEXEC and O_NONBLOCK */
#include <linux/fcntl.h>

/* Flags for eventfd2. */
#define EFD_CLOEXEC O_CLOEXEC
#define EFD_NONBLOCK O_NONBLOCK

struct file *eventfd_fget(int fd);
int eventfd_signal(struct file *file, int n);
Expand Down

0 comments on commit a0fbf61

Please sign in to comment.