[systemd-devel] [PATCH] Check the right variable for failed open()

David Herrmann dh.herrmann at gmail.com
Thu May 8 04:26:40 PDT 2014


Hi

On Thu, May 8, 2014 at 12:57 PM, Łukasz Stelmach <l.stelmach at samsung.com> wrote:
> ---
> I am not quite sure but checking r in this if does not make much sense.

Nice catch. Applied.

Thanks
David

>  src/core/cgroup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/core/cgroup.c b/src/core/cgroup.c
> index 3aeaf56..29ab645 100644
> --- a/src/core/cgroup.c
> +++ b/src/core/cgroup.c
> @@ -920,7 +920,7 @@ int manager_setup_cgroup(Manager *m) {
>          safe_close(m->pin_cgroupfs_fd);
>
>          m->pin_cgroupfs_fd = open(path, O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOCTTY|O_NONBLOCK);
> -        if (r < 0) {
> +        if (m->pin_cgroupfs_fd < 0) {
>                  log_error("Failed to open pin file: %m");
>                  return -errno;
>          }
> --
> 1.9.1
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


More information about the systemd-devel mailing list