Skip to content

cgroup-utils: errno used after success #1988

@eriksjolund

Description

@eriksjolund

errno is used after success

here

ret = rmdir_all (cgroup_path);
if (ret < 0)
{
if (retry_count >= max_attempts)
return crun_make_error (err, errno, "cannot delete path `%s`", cgroup_path);

and here

ret = rmdir_all (cgroup_path);
if (ret < 0)
{
if (retry_count >= max_attempts)
return crun_make_error (err, errno, "cannot destroy subsystem `%s` at path `%s`", subsystem, cgroup_path);

The successful call could be close() here

TEMP_FAILURE_RETRY (close (dfd));
return -1;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions