[systemd-devel] [PATCH 2/3] udev: check return value of uname.

Lennart Poettering lennart at poettering.net
Wed Mar 27 08:50:48 PDT 2013


On Wed, 27.03.13 15:16, Vaclav Pavlin (vpavlin at redhat.com) wrote:

> From: Václav Pavlín <vpavlin at redhat.com>
> 
> ---
>  src/udev/udevd.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/udev/udevd.c b/src/udev/udevd.c
> index b30bedf..379168d 100644
> --- a/src/udev/udevd.c
> +++ b/src/udev/udevd.c
> @@ -819,7 +819,9 @@ static void static_dev_create_from_modules(struct udev *udev)
>          char buf[4096];
>          FILE *f;
>  
> -        uname(&kernel);
> +        if (uname(&kernel) < 0)
> +                return;
> +

I wouldn't mind enclosing this in assert_se(), since this specific
system call cannot realistically fail.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list