From 1c369add8ec69e19c59a1e60749a88e9cda4b3e6 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 4 May 2014 20:17:47 +0200 Subject: [PATCH] example: close output file Signed-off-by: Felix Fietkau --- uclient-example.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/uclient-example.c b/uclient-example.c index 2874ec2..bee5068 100644 --- a/uclient-example.c +++ b/uclient-example.c @@ -85,6 +85,10 @@ static int open_output_file(const char *path, bool create) static void request_done(struct uclient *cl) { + if (output_fd >= 0) { + close(output_fd); + output_fd = -1; + } uclient_disconnect(cl); uloop_end(); } -- 2.25.1