From: Yu Watanabe Date: Thu, 21 Aug 2025 20:02:52 +0000 (+0900) Subject: sd-journal: use -EBADF for invalidated file descriptor X-Git-Tag: v259-rc1~82^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=09811f99f4d5c991d4f44f2775af37dc93846782;p=thirdparty%2Fsystemd.git sd-journal: use -EBADF for invalidated file descriptor --- 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; }