diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd/journald-fix-fd-leak-in-journal_file_empty.patch')
-rw-r--r-- | meta/recipes-core/systemd/systemd/journald-fix-fd-leak-in-journal_file_empty.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/journald-fix-fd-leak-in-journal_file_empty.patch b/meta/recipes-core/systemd/systemd/journald-fix-fd-leak-in-journal_file_empty.patch new file mode 100644 index 0000000000..a83c858b2a --- /dev/null +++ b/meta/recipes-core/systemd/systemd/journald-fix-fd-leak-in-journal_file_empty.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | journald: fix fd leak in journal_file_empty | ||
2 | Before my previous patch, journal_file_empty wasn't be called with the | ||
3 | correct filename. Now that it's being called with the correct filename | ||
4 | it leaks file descriptors. This patch closes the file descriptors before | ||
5 | returning. | ||
6 | |||
7 | Signed-off-by: George McCollister <george.mccollister@gmail.com> | ||
8 | |||
9 | |||
10 | Index: systemd-206/src/journal/journal-vacuum.c | ||
11 | =================================================================== | ||
12 | --- systemd-206.orig/src/journal/journal-vacuum.c 2013-07-21 19:43:28.146183128 -0300 | ||
13 | +++ systemd-206/src/journal/journal-vacuum.c 2014-01-29 20:43:27.492343295 -0200 | ||
14 | @@ -129,9 +129,9 @@ | ||
15 | } | ||
16 | |||
17 | static int journal_file_empty(int dir_fd, const char *name) { | ||
18 | - int fd, r; | ||
19 | + int r; | ||
20 | le64_t n_entries; | ||
21 | - | ||
22 | + _cleanup_close_ int fd; | ||
23 | fd = openat(dir_fd, name, O_RDONLY|O_CLOEXEC|O_NOFOLLOW|O_NONBLOCK); | ||
24 | if (fd < 0) | ||
25 | return -errno; | ||
26 | |||
27 | Upstream-Status: Backport [207] | ||