summaryrefslogtreecommitdiff
path: root/networking/tftp.c
diff options
context:
space:
mode:
authorDenis Vlasenko2006-11-21 10:15:25 +0000
committerDenis Vlasenko2006-11-21 10:15:25 +0000
commit04291bc5aee1e020997894cfd497d14392ad2ced (patch)
treef9f70d597f2476efe5819b15e8d749725653773f /networking/tftp.c
parent3eb91c2e3594f379f357bfcc85105b6b76a11781 (diff)
downloadbusybox-04291bc5aee1e020997894cfd497d14392ad2ced.zip
busybox-04291bc5aee1e020997894cfd497d14392ad2ced.tar.gz
httpd: slight reduction of #ifdef forest
few other applets: #ifdef CONFIG_ -> #if ENABLE_ traceroute: fix exposed bugs defconfig: update
Diffstat (limited to 'networking/tftp.c')
-rw-r--r--networking/tftp.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/networking/tftp.c b/networking/tftp.c
index 6213d66..64d376f 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -60,7 +60,7 @@ static const char *const tftp_bb_error_msg[] = {
#endif
-#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE
+#if ENABLE_FEATURE_TFTP_BLOCKSIZE
static int tftp_blocksize_check(int blocksize, int bufsize)
{
@@ -204,7 +204,7 @@ static int tftp(const int cmd, const struct hostent *host,
memcpy(cp, MODE_OCTET, MODE_OCTET_LEN);
cp += MODE_OCTET_LEN;
-#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE
+#if ENABLE_FEATURE_TFTP_BLOCKSIZE
len = tftp_bufsize - 4; /* data block size */
@@ -261,7 +261,7 @@ static int tftp(const int cmd, const struct hostent *host,
len = cp - buf;
-#ifdef CONFIG_DEBUG_TFTP
+#if ENABLE_DEBUG_TFTP
fprintf(stderr, "sending %u bytes\n", len);
for (cp = buf; cp < &buf[len]; cp++)
fprintf(stderr, "%02x ", (unsigned char) *cp);
@@ -337,7 +337,7 @@ static int tftp(const int cmd, const struct hostent *host,
opcode = ntohs(*((unsigned short *) buf));
tmp = ntohs(*((unsigned short *) &buf[2]));
-#ifdef CONFIG_DEBUG_TFTP
+#if ENABLE_DEBUG_TFTP
fprintf(stderr, "received %d bytes: %04x %04x\n", len, opcode, tmp);
#endif
@@ -359,7 +359,7 @@ static int tftp(const int cmd, const struct hostent *host,
break;
}
-#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE
+#if ENABLE_FEATURE_TFTP_BLOCKSIZE
if (want_option_ack) {
want_option_ack = 0;
@@ -382,7 +382,7 @@ static int tftp(const int cmd, const struct hostent *host,
} else {
opcode = TFTP_ACK;
}
-#ifdef CONFIG_DEBUG_TFTP
+#if ENABLE_DEBUG_TFTP
fprintf(stderr, "using %s %u\n", OPTION_BLOCKSIZE,
blksize);
#endif
@@ -448,7 +448,7 @@ static int tftp(const int cmd, const struct hostent *host,
}
}
-#ifdef CONFIG_FEATURE_CLEAN_UP
+#if ENABLE_FEATURE_CLEAN_UP
close(socketfd);
free(buf);
#endif
@@ -470,7 +470,7 @@ int tftp_main(int argc, char **argv)
/* figure out what to pass to getopt */
-#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE
+#if ENABLE_FEATURE_TFTP_BLOCKSIZE
char *sblocksize = NULL;
#define BS "b:"
@@ -480,7 +480,7 @@ int tftp_main(int argc, char **argv)
#define BS_ARG
#endif
-#ifdef CONFIG_FEATURE_TFTP_GET
+#if ENABLE_FEATURE_TFTP_GET
#define GET "g"
#define GET_COMPL ":g"
#else
@@ -488,7 +488,7 @@ int tftp_main(int argc, char **argv)
#define GET_COMPL
#endif
-#ifdef CONFIG_FEATURE_TFTP_PUT
+#if ENABLE_FEATURE_TFTP_PUT
#define PUT "p"
#define PUT_COMPL ":p"
#else
@@ -505,16 +505,16 @@ int tftp_main(int argc, char **argv)
cmd = getopt32(argc, argv, GET PUT "l:r:" BS, &localfile, &remotefile BS_ARG);
cmd &= (tftp_cmd_get | tftp_cmd_put);
-#ifdef CONFIG_FEATURE_TFTP_GET
+#if ENABLE_FEATURE_TFTP_GET
if (cmd == tftp_cmd_get)
flags = O_WRONLY | O_CREAT | O_TRUNC;
#endif
-#ifdef CONFIG_FEATURE_TFTP_PUT
+#if ENABLE_FEATURE_TFTP_PUT
if (cmd == tftp_cmd_put)
flags = O_RDONLY;
#endif
-#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE
+#if ENABLE_FEATURE_TFTP_BLOCKSIZE
if (sblocksize) {
blocksize = xatoi_u(sblocksize);
if (!tftp_blocksize_check(blocksize, 0)) {
@@ -542,7 +542,7 @@ int tftp_main(int argc, char **argv)
host = xgethostbyname(argv[optind]);
port = bb_lookup_port(argv[optind + 1], "udp", 69);
-#ifdef CONFIG_DEBUG_TFTP
+#if ENABLE_DEBUG_TFTP
fprintf(stderr, "using server \"%s\", remotefile \"%s\", "
"localfile \"%s\".\n",
inet_ntoa(*((struct in_addr *) host->h_addr)),