summaryrefslogtreecommitdiff
path: root/networking/ftpgetput.c
diff options
context:
space:
mode:
authorRob Landley2006-01-10 06:36:00 +0000
committerRob Landley2006-01-10 06:36:00 +0000
commitbc059bc7fa4383813f0772a380b59a643af79636 (patch)
tree45239bc2f692ba429aee95b6c343b8d48243f328 /networking/ftpgetput.c
parent9e4100bf95ab2f1b9a2fe76a8ac0e7a3666cd8b1 (diff)
downloadbusybox-bc059bc7fa4383813f0772a380b59a643af79636.zip
busybox-bc059bc7fa4383813f0772a380b59a643af79636.tar.gz
The brain-dead FTP servers on Solaris don't support the size command.
Diffstat (limited to 'networking/ftpgetput.c')
-rw-r--r--networking/ftpgetput.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c
index 1d5b186..7a0ba77 100644
--- a/networking/ftpgetput.c
+++ b/networking/ftpgetput.c
@@ -143,6 +143,9 @@ static int ftp_recieve(ftp_host_info_t *server, FILE *control_stream,
if (safe_strtoul(buf + 4, &value))
bb_error_msg_and_die("SIZE error: %s", buf + 4);
filesize = value;
+ } else {
+ filesize = -1;
+ do_continue = 0;
}
if ((local_path[0] == '-') && (local_path[1] == '\0')) {
@@ -185,8 +188,12 @@ static int ftp_recieve(ftp_host_info_t *server, FILE *control_stream,
}
/* Copy the file */
- if (bb_copyfd_size(fd_data, fd_local, filesize) == -1) {
- exit(EXIT_FAILURE);
+ if (filesize != -1) {
+ if (-1 == bb_copyfd_size(fd_data, fd_local, filesize))
+ exit(EXIT_FAILURE);
+ } else {
+ if (-1 == bb_copyfd_eof(fd_data, fd_local))
+ exit(EXIT_FAILURE);
}
/* close it all down */