File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -574,7 +574,7 @@ asmlinkage long sys_inotify_init1(int flags)
574
574
struct file * filp ;
575
575
int fd , ret ;
576
576
577
- if (flags & ~IN_CLOEXEC )
577
+ if (flags & ~( IN_CLOEXEC | IN_NONBLOCK ) )
578
578
return - EINVAL ;
579
579
580
580
fd = get_unused_fd_flags (flags & O_CLOEXEC );
@@ -613,7 +613,7 @@ asmlinkage long sys_inotify_init1(int flags)
613
613
filp -> f_path .dentry = dget (inotify_mnt -> mnt_root );
614
614
filp -> f_mapping = filp -> f_path .dentry -> d_inode -> i_mapping ;
615
615
filp -> f_mode = FMODE_READ ;
616
- filp -> f_flags = O_RDONLY ;
616
+ filp -> f_flags = O_RDONLY | ( flags & O_NONBLOCK ) ;
617
617
filp -> private_data = dev ;
618
618
619
619
INIT_LIST_HEAD (& dev -> events );
Original file line number Diff line number Diff line change 7
7
#ifndef _LINUX_INOTIFY_H
8
8
#define _LINUX_INOTIFY_H
9
9
10
- /* For O_CLOEXEC */
10
+ /* For O_CLOEXEC and O_NONBLOCK */
11
11
#include <linux/fcntl.h>
12
12
#include <linux/types.h>
13
13
@@ -67,6 +67,7 @@ struct inotify_event {
67
67
68
68
/* Flags for sys_inotify_init1. */
69
69
#define IN_CLOEXEC O_CLOEXEC
70
+ #define IN_NONBLOCK O_NONBLOCK
70
71
71
72
#ifdef __KERNEL__
72
73
You can’t perform that action at this time.
0 commit comments