summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Lewis2019-01-04 18:26:04 +0100
committerDenys Vlasenko2019-01-04 18:27:28 +0100
commit46fc3290c20a0468c02bd771a8c548c0e1b23e47 (patch)
treef358007af8a664e40d49c296933148f89744aa83
parent64f35361f42946e6e19bcbaa5a8be7b58a159c42 (diff)
downloadbusybox-46fc3290c20a0468c02bd771a8c548c0e1b23e47.zip
busybox-46fc3290c20a0468c02bd771a8c548c0e1b23e47.tar.gz
wget: notify on download begin and end
When using -o to file the progress meter is not displayed, so write that we started the download and that we finished it. function old new delta retrieve_file_data 465 561 +96 wget_main 2412 2432 +20 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 116/0) Total: 116 bytes text data bss dec hex filename 979022 485 7296 986803 f0eb3 busybox_old 979224 485 7296 987005 f0f7d busybox_unstripped Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/wget.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/networking/wget.c b/networking/wget.c
index da629cc..3a02de6 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -876,6 +876,10 @@ static void NOINLINE retrieve_file_data(FILE *dfp)
polldata.fd = fileno(dfp);
polldata.events = POLLIN | POLLPRI;
#endif
+ if (G.output_fd == 1)
+ fprintf(stderr, "writing to stdout\n");
+ else
+ fprintf(stderr, "saving to '%s'\n", G.fname_out);
progress_meter(PROGRESS_START);
if (G.chunked)
@@ -1021,6 +1025,10 @@ static void NOINLINE retrieve_file_data(FILE *dfp)
G.chunked = 0; /* makes it show 100% even for chunked download */
G.got_clen = 1; /* makes it show 100% even for download of (formerly) unknown size */
progress_meter(PROGRESS_END);
+ if (G.output_fd == 1)
+ fprintf(stderr, "written to stdout\n");
+ else
+ fprintf(stderr, "'%s' saved\n", G.fname_out);
}
static void download_one_url(const char *url)
@@ -1380,6 +1388,8 @@ However, in real world it was observed that some web servers
xclose(G.output_fd);
G.output_fd = -1;
}
+ } else {
+ fprintf(stderr, "remote file exists\n");
}
if (dfp != sfp) {