summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-04-21 12:34:37 +0200
committerLennart Poettering <lennart@poettering.net>2023-04-21 12:41:15 +0200
commit67458536afcdceb25b63b8367837ab5402f3983e (patch)
tree151dd10f3a6ea5766ce393594e0d09c0a6739d1f /src/journal
parent21453b8b4bfb4d1fa3efd1df3fe1208d48cbd41b (diff)
downloadsystemd-67458536afcdceb25b63b8367837ab5402f3983e.tar.gz
tree-wide: convert more cases do DEVNUM_FORMAT_STR()/DEVNUM_FORMAT_VAL()
Let's use our nice macros a bit more. (Not comprehensive)
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journalctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 5c07caa8f3..12119b302c 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -26,6 +26,7 @@
#include "chase.h"
#include "chattr-util.h"
#include "constants.h"
+#include "devnum-util.h"
#include "dissect-image.h"
#include "fd-util.h"
#include "fileio.h"
@@ -194,7 +195,7 @@ static int add_matches_for_device(sd_journal *j, const char *devpath) {
r = sd_device_new_from_stat_rdev(&device, &st);
if (r < 0)
- return log_error_errno(r, "Failed to get device from devnum %u:%u: %m", major(st.st_rdev), minor(st.st_rdev));
+ return log_error_errno(r, "Failed to get device from devnum " DEVNUM_FORMAT_STR ": %m", DEVNUM_FORMAT_VAL(st.st_rdev));
for (d = device; d; ) {
_cleanup_free_ char *match = NULL;
@@ -224,7 +225,7 @@ static int add_matches_for_device(sd_journal *j, const char *devpath) {
if (r < 0)
return log_error_errno(r, "Failed to stat() device node \"%s\": %m", devnode);
- r = asprintf(&match1, "_KERNEL_DEVICE=%c%u:%u", S_ISBLK(st.st_mode) ? 'b' : 'c', major(st.st_rdev), minor(st.st_rdev));
+ r = asprintf(&match1, "_KERNEL_DEVICE=%c" DEVNUM_FORMAT_STR, S_ISBLK(st.st_mode) ? 'b' : 'c', DEVNUM_FORMAT_VAL(st.st_rdev));
if (r < 0)
return log_oom();