From 09811f99f4d5c991d4f44f2775af37dc93846782 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 22 Aug 2025 05:02:52 +0900 Subject: [PATCH] sd-journal: use -EBADF for invalidated file descriptor --- src/libsystemd/sd-journal/sd-journal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libsystemd/sd-journal/sd-journal.c b/src/libsystemd/sd-journal/sd-journal.c index 840f6d684b4..195fdb72f21 100644 --- a/src/libsystemd/sd-journal/sd-journal.c +++ b/src/libsystemd/sd-journal/sd-journal.c @@ -1740,7 +1740,7 @@ static int add_file_by_name( if (!path) return -ENOMEM; - return add_any_file(j, -1, path); + return add_any_file(j, /* fd = */ -EBADF, path); } static int remove_file_by_name( @@ -2427,7 +2427,7 @@ _public_ int sd_journal_open_files(sd_journal **ret, const char **paths, int fla return -ENOMEM; STRV_FOREACH(path, paths) { - r = add_any_file(j, -1, *path); + r = add_any_file(j, /* fd = */ -EBADF, *path); if (r < 0) return r; } @@ -2514,7 +2514,7 @@ _public_ int sd_journal_open_files_fd(sd_journal **ret, int fds[], unsigned n_fd if (r < 0) goto fail; - r = add_any_file(j, fds[i], NULL); + r = add_any_file(j, fds[i], /* path = */ NULL); if (r < 0) goto fail; } -- 2.47.3