]> git.ipfire.org Git - people/ms/systemd.git/commitdiff
cgroup: add cgroup_bonding_to_string() call
authorLennart Poettering <lennart@poettering.net>
Sun, 18 Apr 2010 01:04:54 +0000 (03:04 +0200)
committerLennart Poettering <lennart@poettering.net>
Sun, 18 Apr 2010 01:04:54 +0000 (03:04 +0200)
cgroup.c
cgroup.h

index 24bbe1aa15637132813c8cf6f747787455ecb3ac..f5c2592ce8276a0760afd4f916435074c0404a74 100644 (file)
--- a/cgroup.c
+++ b/cgroup.c
@@ -540,3 +540,14 @@ CGroupBonding *cgroup_bonding_find_list(CGroupBonding *first, const char *contro
 
         return NULL;
 }
+
+char *cgroup_bonding_to_string(CGroupBonding *b) {
+        char *r;
+
+        assert(b);
+
+        if (asprintf(&r, "%s:%s", b->controller, b->path) < 0)
+                return NULL;
+
+        return r;
+}
index b7e18bf620825025d1ee1d64071226f29d045ced..6b677d535d8caf69d431122fc56e566ee4ca7263 100644 (file)
--- a/cgroup.h
+++ b/cgroup.h
@@ -70,6 +70,8 @@ int cgroup_bonding_is_empty_list(CGroupBonding *first);
 
 CGroupBonding *cgroup_bonding_find_list(CGroupBonding *first, const char *controller);
 
+char *cgroup_bonding_to_string(CGroupBonding *b);
+
 #include "manager.h"
 
 int manager_setup_cgroup(Manager *m);