diff options
| author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-01-10 06:36:00 +0000 |
|---|---|---|
| committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-01-10 06:36:00 +0000 |
| commit | 3b239ee4ea18c9ed169378acae2c157d0abdbbb6 (patch) | |
| tree | 45239bc2f692ba429aee95b6c343b8d48243f328 | |
| parent | 7b184e6abc80c966017dae8fc7e196a04ce0b4c6 (diff) | |
| download | busybox-w32-3b239ee4ea18c9ed169378acae2c157d0abdbbb6.tar.gz busybox-w32-3b239ee4ea18c9ed169378acae2c157d0abdbbb6.tar.bz2 busybox-w32-3b239ee4ea18c9ed169378acae2c157d0abdbbb6.zip | |
The brain-dead FTP servers on Solaris don't support the size command.
git-svn-id: svn://busybox.net/trunk/busybox@13222 69ca8d6d-28ef-0310-b511-8ec308f3f277
| -rw-r--r-- | networking/ftpgetput.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c index 1d5b18624..7a0ba7772 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, | |||
| 143 | if (safe_strtoul(buf + 4, &value)) | 143 | if (safe_strtoul(buf + 4, &value)) |
| 144 | bb_error_msg_and_die("SIZE error: %s", buf + 4); | 144 | bb_error_msg_and_die("SIZE error: %s", buf + 4); |
| 145 | filesize = value; | 145 | filesize = value; |
| 146 | } else { | ||
| 147 | filesize = -1; | ||
| 148 | do_continue = 0; | ||
| 146 | } | 149 | } |
| 147 | 150 | ||
| 148 | if ((local_path[0] == '-') && (local_path[1] == '\0')) { | 151 | if ((local_path[0] == '-') && (local_path[1] == '\0')) { |
| @@ -185,8 +188,12 @@ static int ftp_recieve(ftp_host_info_t *server, FILE *control_stream, | |||
| 185 | } | 188 | } |
| 186 | 189 | ||
| 187 | /* Copy the file */ | 190 | /* Copy the file */ |
| 188 | if (bb_copyfd_size(fd_data, fd_local, filesize) == -1) { | 191 | if (filesize != -1) { |
| 189 | exit(EXIT_FAILURE); | 192 | if (-1 == bb_copyfd_size(fd_data, fd_local, filesize)) |
| 193 | exit(EXIT_FAILURE); | ||
| 194 | } else { | ||
| 195 | if (-1 == bb_copyfd_eof(fd_data, fd_local)) | ||
| 196 | exit(EXIT_FAILURE); | ||
| 190 | } | 197 | } |
| 191 | 198 | ||
| 192 | /* close it all down */ | 199 | /* close it all down */ |
