Skip to content

Commit

Permalink
Merge pull request #1258 from eriksjolund/fix_error_return_value
Browse files Browse the repository at this point in the history
cgroup: fix error return value
  • Loading branch information
giuseppe authored Aug 6, 2023
2 parents 299d8a2 + 31eeb19 commit a6e2f2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcrun/cgroup-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,13 @@ read_unified_cgroup_pid (pid_t pid, char **path, libcrun_error_t *err)

from = strstr (content, "0::");
if (UNLIKELY (from == NULL))
return crun_make_error (err, -1, "cannot find cgroup2 for the process `%d`", pid);
return crun_make_error (err, 0, "cannot find cgroup2 for the process `%d`", pid);

from += 3;

to = strchr (from, '\n');
if (UNLIKELY (to == NULL))
return crun_make_error (err, -1, "cannot parse `%s`", cgroup_path);
return crun_make_error (err, 0, "cannot parse `%s`", cgroup_path);
*to = '\0';

*path = xstrdup (from);
Expand Down

0 comments on commit a6e2f2e

Please sign in to comment.