static void request_done(struct uclient *cl)
{
- if (output_fd >= 0) {
+ if (output_fd >= 0 && !output_file) {
close(output_fd);
output_fd = -1;
}
fprintf(stderr,
"Usage: %s [options] <URL>\n"
"Options:\n"
+ " -q: Turn off status messages\n"
" -O <file>: Redirect output to file (use \"-\" for stdout)\n"
"\n"
"HTTPS options:\n"
uclient_free(cl);
+ if (output_fd >= 0 && output_fd != STDOUT_FILENO)
+ close(output_fd);
+
if (ssl_ctx)
ssl_ops->context_free(ssl_ctx);