Skip to content

Commit

Permalink
wrapper: Add support for getting multiline values
Browse files Browse the repository at this point in the history
If the multiline_value is set in a struct control_value, return it when
cgroup_get_value_string() is invoked.  This allows for the reading of
multiline values via the C API and the python bindings.

Signed-off-by: Tom Hromatka <[email protected]>
  • Loading branch information
drakenclimber committed Apr 24, 2024
1 parent 77b9a52 commit 46210dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,10 @@ int cgroup_get_value_string(struct cgroup_controller *controller, const char *na
struct control_value *val = controller->values[i];

if (!strcmp(val->name, name)) {
*value = strdup(val->value);
if (val->multiline_value)
*value = strdup(val->multiline_value);
else
*value = strdup(val->value);

if (!*value)
return ECGOTHER;
Expand Down

0 comments on commit 46210dd

Please sign in to comment.