aboutsummaryrefslogtreecommitdiffstats
path: root/fs/inotify_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/inotify_user.c')
-rw-r--r--fs/inotify_user.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/inotify_user.c b/fs/inotify_user.c
index 6676c06bb7c1..851005998cd4 100644
--- a/fs/inotify_user.c
+++ b/fs/inotify_user.c
@@ -566,7 +566,7 @@ static const struct inotify_operations inotify_user_ops = {
566 .destroy_watch = free_inotify_user_watch, 566 .destroy_watch = free_inotify_user_watch,
567}; 567};
568 568
569asmlinkage long sys_inotify_init(void) 569asmlinkage long sys_inotify_init1(int flags)
570{ 570{
571 struct inotify_device *dev; 571 struct inotify_device *dev;
572 struct inotify_handle *ih; 572 struct inotify_handle *ih;
@@ -574,7 +574,10 @@ asmlinkage long sys_inotify_init(void)
574 struct file *filp; 574 struct file *filp;
575 int fd, ret; 575 int fd, ret;
576 576
577 fd = get_unused_fd(); 577 if (flags & ~IN_CLOEXEC)
578 return -EINVAL;
579
580 fd = get_unused_fd_flags(flags & O_CLOEXEC);
578 if (fd < 0) 581 if (fd < 0)
579 return fd; 582 return fd;
580 583
@@ -638,6 +641,11 @@ out_put_fd:
638 return ret; 641 return ret;
639} 642}
640 643
644asmlinkage long sys_inotify_init(void)
645{
646 return sys_inotify_init1(0);
647}
648
641asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, u32 mask) 649asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, u32 mask)
642{ 650{
643 struct inode *inode; 651 struct inode *inode;