richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
84b277
From 31cd4f1513656008646ee542e451338112fc8158 Mon Sep 17 00:00:00 2001
84b277
From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= <l.stelmach@samsung.com>
84b277
Date: Thu, 8 May 2014 12:57:26 +0200
84b277
Subject: [PATCH] core: check the right variable for failed open()
84b277
84b277
(cherry-picked from cd7affaeea16d3904354b810a292e594dfef25dd)
84b277
84b277
Resolves: #1147524
84b277
---
84b277
 src/core/cgroup.c | 2 +-
84b277
 1 file changed, 1 insertion(+), 1 deletion(-)
84b277
84b277
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
84b277
index 32e2599..c215a86 100644
84b277
--- a/src/core/cgroup.c
84b277
+++ b/src/core/cgroup.c
84b277
@@ -661,7 +661,7 @@ int manager_setup_cgroup(Manager *m) {
84b277
                 close_nointr_nofail(m->pin_cgroupfs_fd);
84b277
 
84b277
         m->pin_cgroupfs_fd = open(path, O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOCTTY|O_NONBLOCK);
84b277
-        if (r < 0) {
84b277
+        if (m->pin_cgroupfs_fd < 0) {
84b277
                 log_error("Failed to open pin file: %m");
84b277
                 return -errno;
84b277
         }