[systemd-devel] [PATCH 4/5] journal: close fd in sd_journal_send

Lukas Nykryn lnykryn at redhat.com
Wed Apr 10 03:54:01 PDT 2013


---
 src/journal/journal-send.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c
index 4b9109a..ae7f5e8 100644
--- a/src/journal/journal-send.c
+++ b/src/journal/journal-send.c
@@ -200,7 +200,9 @@ finish:
 
 _public_ int sd_journal_sendv(const struct iovec *iov, int n) {
         PROTECT_ERRNO;
-        int fd, buffer_fd;
+        _cleanup_close_ int fd = -1;
+        int buffer_fd;
+
         struct iovec *w;
         uint64_t *l;
         int i, j = 0;
-- 
1.8.1.4



More information about the systemd-devel mailing list