Skip to content

Commit 9e77716

Browse files
lucvooChristian Brauner
authored andcommitted
fork: fix pidfd_poll()'s return type
pidfd_poll() is defined as returning 'unsigned int' but the .poll method is declared as returning '__poll_t', a bitwise type. Fix this by using the proper return type and using the EPOLL constants instead of the POLL ones, as required for __poll_t. Fixes: b53b0b9 ("pidfd: add polling support") Cc: Joel Fernandes (Google) <[email protected]> Cc: [email protected] # 5.3 Signed-off-by: Luc Van Oostenryck <[email protected]> Reviewed-by: Christian Brauner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent af42d34 commit 9e77716

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/fork.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,11 +1708,11 @@ static void pidfd_show_fdinfo(struct seq_file *m, struct file *f)
17081708
/*
17091709
* Poll support for process exit notification.
17101710
*/
1711-
static unsigned int pidfd_poll(struct file *file, struct poll_table_struct *pts)
1711+
static __poll_t pidfd_poll(struct file *file, struct poll_table_struct *pts)
17121712
{
17131713
struct task_struct *task;
17141714
struct pid *pid = file->private_data;
1715-
int poll_flags = 0;
1715+
__poll_t poll_flags = 0;
17161716

17171717
poll_wait(file, &pid->wait_pidfd, pts);
17181718

@@ -1724,7 +1724,7 @@ static unsigned int pidfd_poll(struct file *file, struct poll_table_struct *pts)
17241724
* group, then poll(2) should block, similar to the wait(2) family.
17251725
*/
17261726
if (!task || (task->exit_state && thread_group_empty(task)))
1727-
poll_flags = POLLIN | POLLRDNORM;
1727+
poll_flags = EPOLLIN | EPOLLRDNORM;
17281728
rcu_read_unlock();
17291729

17301730
return poll_flags;

0 commit comments

Comments
 (0)