aboutsummaryrefslogtreecommitdiff
path: root/networking/tftp.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-06-16 07:32:40 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-06-16 07:32:40 +0000
commit31e128636535a58be64636c8de93a6dad8b39ac0 (patch)
tree897bcde89f586417a0cc0ebbac6e69afaeb683fe /networking/tftp.c
parent8474cd38f3cd3446088fd158c7f34fd6860269ab (diff)
downloadbusybox-w32-31e128636535a58be64636c8de93a6dad8b39ac0.tar.gz
busybox-w32-31e128636535a58be64636c8de93a6dad8b39ac0.tar.bz2
busybox-w32-31e128636535a58be64636c8de93a6dad8b39ac0.zip
tftp: help compiler a bit
Diffstat (limited to 'networking/tftp.c')
-rw-r--r--networking/tftp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/networking/tftp.c b/networking/tftp.c
index 71869e25f..63e045dfb 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -258,6 +258,8 @@ static int tftp_protocol(
258 } 258 }
259 259
260 if (!ENABLE_TFTP || our_lsa) { 260 if (!ENABLE_TFTP || our_lsa) {
261/* gcc 4.3.1 would NOT optimize it out as it should! */
262#if ENABLE_FEATURE_TFTP_BLOCKSIZE
261 if (blksize != TFTP_BLKSIZE_DEFAULT || tsize) { 263 if (blksize != TFTP_BLKSIZE_DEFAULT || tsize) {
262 /* Create and send OACK packet. */ 264 /* Create and send OACK packet. */
263 /* For the download case, block_nr is still 1 - 265 /* For the download case, block_nr is still 1 -
@@ -266,6 +268,7 @@ static int tftp_protocol(
266 opcode = TFTP_OACK; 268 opcode = TFTP_OACK;
267 goto add_blksize_opt; 269 goto add_blksize_opt;
268 } 270 }
271#endif
269 } else { 272 } else {
270/* Removing it, or using if() statement instead of #if may lead to 273/* Removing it, or using if() statement instead of #if may lead to
271 * "warning: null argument where non-null required": */ 274 * "warning: null argument where non-null required": */
@@ -301,6 +304,7 @@ static int tftp_protocol(
301 strcpy(cp, "octet"); 304 strcpy(cp, "octet");
302 cp += sizeof("octet"); 305 cp += sizeof("octet");
303 306
307#if ENABLE_FEATURE_TFTP_BLOCKSIZE
304 if (blksize == TFTP_BLKSIZE_DEFAULT) 308 if (blksize == TFTP_BLKSIZE_DEFAULT)
305 goto send_pkt; 309 goto send_pkt;
306 310
@@ -309,9 +313,11 @@ static int tftp_protocol(
309 bb_error_msg("remote filename is too long"); 313 bb_error_msg("remote filename is too long");
310 goto ret; 314 goto ret;
311 } 315 }
312 USE_FEATURE_TFTP_BLOCKSIZE(want_option_ack = 1;) 316 want_option_ack = 1;
317#endif
313#endif /* ENABLE_TFTP */ 318#endif /* ENABLE_TFTP */
314 319
320#if ENABLE_FEATURE_TFTP_BLOCKSIZE
315 add_blksize_opt: 321 add_blksize_opt:
316#if ENABLE_TFTPD 322#if ENABLE_TFTPD
317 if (tsize) { 323 if (tsize) {
@@ -329,6 +335,7 @@ static int tftp_protocol(
329 cp += sizeof("blksize"); 335 cp += sizeof("blksize");
330 cp += snprintf(cp, 6, "%d", blksize) + 1; 336 cp += snprintf(cp, 6, "%d", blksize) + 1;
331 } 337 }
338#endif
332 /* First packet is built, so skip packet generation */ 339 /* First packet is built, so skip packet generation */
333 goto send_pkt; 340 goto send_pkt;
334 } 341 }