diff options
author | Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> | 2012-03-14 05:27:49 -0400 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2012-03-14 21:29:18 -0400 |
commit | 6041e8346f2165679c2184cab60db768d6a26a1d (patch) | |
tree | 2c4eb032eb851f240c1b70d1afb214a2c661b886 /security/tomoyo/securityfs_if.c | |
parent | f67dabbdde1fe112dfff05d02890f1e0d54117a8 (diff) |
TOMOYO: Return appropriate value to poll().
"struct file_operations"->poll() expects "unsigned int" return value.
All files in /sys/kernel/security/tomoyo/ directory other than
/sys/kernel/security/tomoyo/query and /sys/kernel/security/tomoyo/audit should
return POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM rather than -ENOSYS.
Also, /sys/kernel/security/tomoyo/query and /sys/kernel/security/tomoyo/audit
should return POLLOUT | POLLWRNORM rather than 0 when there is no data to read.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <james.l.morris@oracle.com>
Diffstat (limited to 'security/tomoyo/securityfs_if.c')
-rw-r--r-- | security/tomoyo/securityfs_if.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/security/tomoyo/securityfs_if.c b/security/tomoyo/securityfs_if.c index 482b2a5f48f0..8592f2fc6ebb 100644 --- a/security/tomoyo/securityfs_if.c +++ b/security/tomoyo/securityfs_if.c | |||
@@ -157,9 +157,10 @@ static int tomoyo_release(struct inode *inode, struct file *file) | |||
157 | * tomoyo_poll - poll() for /sys/kernel/security/tomoyo/ interface. | 157 | * tomoyo_poll - poll() for /sys/kernel/security/tomoyo/ interface. |
158 | * | 158 | * |
159 | * @file: Pointer to "struct file". | 159 | * @file: Pointer to "struct file". |
160 | * @wait: Pointer to "poll_table". | 160 | * @wait: Pointer to "poll_table". Maybe NULL. |
161 | * | 161 | * |
162 | * Returns 0 on success, negative value otherwise. | 162 | * Returns POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM if ready to read/write, |
163 | * POLLOUT | POLLWRNORM otherwise. | ||
163 | */ | 164 | */ |
164 | static unsigned int tomoyo_poll(struct file *file, poll_table *wait) | 165 | static unsigned int tomoyo_poll(struct file *file, poll_table *wait) |
165 | { | 166 | { |