Introduce name_to_handle_at_u64() helper function and use it for getting pidfd ID and cgroup ID (#40500)

This commit is contained in:
Yu Watanabe
2026-02-04 04:37:07 +09:00
committed by GitHub
9 changed files with 58 additions and 69 deletions
+2 -1
View File
@@ -18,6 +18,7 @@
#include "glyph-util.h"
#include "hostname-util.h"
#include "log.h"
#include "mountpoint-util.h"
#include "nulstr-util.h"
#include "output-mode.h"
#include "path-util.h"
@@ -150,7 +151,7 @@ static int show_cgroup_name(
delegate = r > 0;
if (FLAGS_SET(flags, OUTPUT_CGROUP_ID)) {
r = cg_fd_get_cgroupid(fd, &cgroupid);
r = fd_to_handle_u64(fd, &cgroupid);
if (r < 0)
log_debug_errno(r, "Failed to determine cgroup ID of %s, ignoring: %m", path);
}