aboutsummaryrefslogtreecommitdiff
path: root/networking/ftpgetput.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
committerRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /networking/ftpgetput.c
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.bz2
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
Diffstat (limited to 'networking/ftpgetput.c')
-rw-r--r--networking/ftpgetput.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c
index 9f3c78976..767ace9fb 100644
--- a/networking/ftpgetput.c
+++ b/networking/ftpgetput.c
@@ -13,19 +13,8 @@
13 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 13 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
14 */ 14 */
15 15
16#include <sys/ioctl.h>
17
18#include <ctype.h>
19#include <errno.h>
20#include <fcntl.h>
21#include <getopt.h>
22#include <signal.h>
23#include <string.h>
24#include <unistd.h>
25
26#include <sys/socket.h>
27
28#include "busybox.h" 16#include "busybox.h"
17#include <getopt.h>
29 18
30typedef struct ftp_host_info_s { 19typedef struct ftp_host_info_s {
31 char *user; 20 char *user;
@@ -175,9 +164,9 @@ static int ftp_receive(ftp_host_info_t *server, FILE *control_stream,
175 /* only make a local file if we know that one exists on the remote server */ 164 /* only make a local file if we know that one exists on the remote server */
176 if (fd_local == -1) { 165 if (fd_local == -1) {
177 if (do_continue) { 166 if (do_continue) {
178 fd_local = bb_xopen(local_path, O_APPEND | O_WRONLY); 167 fd_local = xopen(local_path, O_APPEND | O_WRONLY);
179 } else { 168 } else {
180 fd_local = bb_xopen(local_path, O_CREAT | O_TRUNC | O_WRONLY); 169 fd_local = xopen(local_path, O_CREAT | O_TRUNC | O_WRONLY);
181 } 170 }
182 } 171 }
183 172
@@ -223,7 +212,7 @@ static int ftp_send(ftp_host_info_t *server, FILE *control_stream,
223 if ((local_path[0] == '-') && (local_path[1] == '\0')) { 212 if ((local_path[0] == '-') && (local_path[1] == '\0')) {
224 fd_local = STDIN_FILENO; 213 fd_local = STDIN_FILENO;
225 } else { 214 } else {
226 fd_local = bb_xopen(local_path, O_RDONLY); 215 fd_local = xopen(local_path, O_RDONLY);
227 fstat(fd_local, &sbuf); 216 fstat(fd_local, &sbuf);
228 217
229 sprintf(buf, "ALLO %lu", (unsigned long)sbuf.st_size); 218 sprintf(buf, "ALLO %lu", (unsigned long)sbuf.st_size);