]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups/cgroup: replace logging functions
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 7 Dec 2019 16:29:12 +0000 (17:29 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 7 Dec 2019 16:29:12 +0000 (17:29 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgroup.c

index 8804d59ac3abfd452241078c7ddf56a2ba2e045c..84171c18d9077a093bd41fc9da036e15476c7057 100644 (file)
@@ -24,19 +24,16 @@ struct cgroup_ops *cgroup_init(struct lxc_conf *conf)
 {
        struct cgroup_ops *cgroup_ops;
 
-       if (!conf) {
-               ERROR("No valid conf given");
-               return NULL;
-       }
+       if (!conf)
+               return log_error_errno(NULL, EINVAL, "No valid conf given");
 
        cgroup_ops = cgfsng_ops_init(conf);
-       if (!cgroup_ops) {
-               ERROR("Failed to initialize cgroup driver");
-               return NULL;
-       }
+       if (!cgroup_ops)
+               return log_error_errno(NULL, errno, "Failed to initialize cgroup driver");
 
-       if (!cgroup_ops->data_init(cgroup_ops))
-               return NULL;
+       if (cgroup_ops->data_init(cgroup_ops))
+               return log_error_errno(NULL, errno,
+                                      "Failed to initialize cgroup data");
 
        TRACE("Initialized cgroup driver %s", cgroup_ops->driver);