From: Felix Fietkau Date: Sun, 4 May 2014 18:17:47 +0000 (+0200) Subject: example: close output file X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuclient.git;a=commitdiff_plain;h=1c369add8ec69e19c59a1e60749a88e9cda4b3e6 example: close output file Signed-off-by: Felix Fietkau --- 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(); }