projects
/
project
/
uclient.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cc75af2
)
example: only close output fd after request completion if -O was not used
author
Felix Fietkau
<nbd@openwrt.org>
Sun, 4 May 2014 18:41:22 +0000
(20:41 +0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Sun, 4 May 2014 18:41:25 +0000
(20:41 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
uclient-example.c
patch
|
blob
|
history
diff --git
a/uclient-example.c
b/uclient-example.c
index
144696c
..
5e478c3
100644
(file)
--- a/
uclient-example.c
+++ b/
uclient-example.c
@@
-86,7
+86,7
@@
static int open_output_file(const char *path, bool create)
static void request_done(struct uclient *cl)
{
- if (output_fd >= 0) {
+ if (output_fd >= 0
&& !output_file
) {
close(output_fd);
output_fd = -1;
}
@@
-327,6
+327,9
@@
int main(int argc, char **argv)
uclient_free(cl);
+ if (output_fd >= 0 && output_fd != STDOUT_FILENO)
+ close(output_fd);
+
if (ssl_ctx)
ssl_ops->context_free(ssl_ctx);