mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valentin Ilie <valentin.ilie@gmail.com>
To: rdunlap@infradead.org, davem@davemloft.net, minipli@googlemail.com
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Valentin Ilie <valentin.ilie@gmail.com>
Subject: [PATCH] connector - documentation: close opened file descriptor
Date: Wed, 17 Sep 2014 20:15:57 +0300	[thread overview]
Message-ID: <1410974157-12470-1-git-send-email-valentin.ilie@gmail.com> (raw)

For the logging process, we use either a file or stdout.

In the case of a file, we need to fix that by calling fclose at the right time.
In the case we end up calling fclose to stdout, we will not impact the program because we do it at its very end.

Signed-off-by: Valentin Ilie <valentin.ilie@gmail.com>
---
 Documentation/connector/ucon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/connector/ucon.c b/Documentation/connector/ucon.c
index 8a4da64..f9d785b 100644
--- a/Documentation/connector/ucon.c
+++ b/Documentation/connector/ucon.c
@@ -246,5 +246,6 @@ int main(int argc, char *argv[])
 	}
 
 	close(s);
+	fclose(out);
 	return 0;
 }
-- 
1.9.1


                 reply	other threads:[~2014-09-17 17:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410974157-12470-1-git-send-email-valentin.ilie@gmail.com \
    --to=valentin.ilie@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minipli@googlemail.com \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®