diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-08 18:07:36 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-11-08 18:07:36 +0100 |
commit | adc08ef19493edac3c3b62c823a1b6c30f582fae (patch) | |
tree | 5d0036327012bb243c79f20eec548c513355b5e8 | |
parent | 8bd0af996226b720342f792129f21581aa08bb5d (diff) | |
download | busybox-w32-adc08ef19493edac3c3b62c823a1b6c30f582fae.tar.gz busybox-w32-adc08ef19493edac3c3b62c823a1b6c30f582fae.tar.bz2 busybox-w32-adc08ef19493edac3c3b62c823a1b6c30f582fae.zip |
tftpd: slight correction to progress bar code
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/tftp.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/networking/tftp.c b/networking/tftp.c index 9a9bd2c34..cd5e50c3c 100644 --- a/networking/tftp.c +++ b/networking/tftp.c | |||
@@ -129,9 +129,8 @@ static void progress_meter(int flag) | |||
129 | 129 | ||
130 | errno = save_errno; | 130 | errno = save_errno; |
131 | } | 131 | } |
132 | static void tftp_progress_init(const char *file) | 132 | static void tftp_progress_init(void) |
133 | { | 133 | { |
134 | G.file = file; | ||
135 | progress_meter(-1); | 134 | progress_meter(-1); |
136 | } | 135 | } |
137 | static void tftp_progress_done(void) | 136 | static void tftp_progress_done(void) |
@@ -139,8 +138,8 @@ static void tftp_progress_done(void) | |||
139 | progress_meter(0); | 138 | progress_meter(0); |
140 | } | 139 | } |
141 | #else | 140 | #else |
142 | # define tftp_progress_init(file) ((void)0) | 141 | # define tftp_progress_init() ((void)0) |
143 | # define tftp_progress_done() ((void)0) | 142 | # define tftp_progress_done() ((void)0) |
144 | #endif | 143 | #endif |
145 | 144 | ||
146 | #if ENABLE_FEATURE_TFTP_BLOCKSIZE | 145 | #if ENABLE_FEATURE_TFTP_BLOCKSIZE |
@@ -411,7 +410,7 @@ static int tftp_protocol( | |||
411 | * we look at server's reply later */ | 410 | * we look at server's reply later */ |
412 | G.size = st.st_size; | 411 | G.size = st.st_size; |
413 | if (remote_file && st.st_size) | 412 | if (remote_file && st.st_size) |
414 | tftp_progress_init(remote_file); | 413 | tftp_progress_init(); |
415 | # endif | 414 | # endif |
416 | } | 415 | } |
417 | #endif | 416 | #endif |
@@ -567,7 +566,7 @@ static int tftp_protocol( | |||
567 | if (res) { | 566 | if (res) { |
568 | G.size = bb_strtoull(res, NULL, 10); | 567 | G.size = bb_strtoull(res, NULL, 10); |
569 | if (remote_file && G.size) | 568 | if (remote_file && G.size) |
570 | tftp_progress_init(remote_file); | 569 | tftp_progress_init(); |
571 | } | 570 | } |
572 | } | 571 | } |
573 | # endif | 572 | # endif |
@@ -715,6 +714,9 @@ int tftp_main(int argc UNUSED_PARAM, char **argv) | |||
715 | remote_file, local_file); | 714 | remote_file, local_file); |
716 | # endif | 715 | # endif |
717 | 716 | ||
717 | # if ENABLE_FEATURE_TFTP_PROGRESS_BAR | ||
718 | G.file = remote_file; | ||
719 | # endif | ||
718 | result = tftp_protocol( | 720 | result = tftp_protocol( |
719 | NULL /*our_lsa*/, peer_lsa, | 721 | NULL /*our_lsa*/, peer_lsa, |
720 | local_file, remote_file | 722 | local_file, remote_file |