lkml.org 
[lkml]   [2019]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/2] pidfd: add P_PIDFD to waitid()
On 07/28, Christian Brauner wrote:
>
> +static struct pid *pidfd_get_pid(unsigned int fd)
> +{
> + struct fd f;
> + struct pid *pid;
> +
> + f = fdget(fd);
> + if (!f.file)
> + return ERR_PTR(-EBADF);
> +
> + pid = pidfd_pid(f.file);
> + if (!IS_ERR(pid))
> + get_pid(pid);
> +
> + fdput(f);
> + return pid;
> +}

Agreed, this looks better than the previous version.

FWIW,

Reviewed-by: Oleg Nesterov <oleg@redhat.com>

\
 
 \ /
  Last update: 2019-07-29 16:28    [W:0.120 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site