From a0bac391ff72105d555e700a750a87eb130b2ad8 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Wed, 4 Jun 2025 17:16:25 +0100 Subject: [PATCH] libkmod: don't use %m on read_str_ulong() failure The function returns the actual error itself, identically to the signed variant - read_str_long(). Unlike the signed variant, one of ulong's users incorrectly uses %m instead of strerror(-err). Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/368 Signed-off-by: Lucas De Marchi --- libkmod/libkmod-module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c index 229c6bca..7bf37bba 100644 --- a/libkmod/libkmod-module.c +++ b/libkmod/libkmod-module.c @@ -1673,8 +1673,8 @@ KMOD_EXPORT struct kmod_list *kmod_module_get_sections(const struct kmod_module err = read_str_ulong(fd, &address, 16); close(fd); if (err < 0) { - ERR(mod->ctx, "could not read long from '%s/%s': %m\n", dname, - dent->d_name); + ERR(mod->ctx, "could not read long from '%s/%s': %s\n", dname, + dent->d_name, strerror(-err)); goto fail; } -- 2.47.3