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

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Wed Apr 10 16:07:05 PDT 2013


On Wed, Apr 10, 2013 at 12:54:01PM +0200, Lukas Nykryn wrote:
> ---
>  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;
> +
journal_fd() returns a global resource, it shouldn't be closed.

Zbyszek


More information about the systemd-devel mailing list