diff options
author | Denis Vlasenko | 2008-06-16 07:32:40 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-06-16 07:32:40 +0000 |
commit | 31e128636535a58be64636c8de93a6dad8b39ac0 (patch) | |
tree | 897bcde89f586417a0cc0ebbac6e69afaeb683fe | |
parent | 8474cd38f3cd3446088fd158c7f34fd6860269ab (diff) | |
download | busybox-31e128636535a58be64636c8de93a6dad8b39ac0.zip busybox-31e128636535a58be64636c8de93a6dad8b39ac0.tar.gz |
tftp: help compiler a bit
-rw-r--r-- | networking/tftp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/networking/tftp.c b/networking/tftp.c index 71869e2..63e045d 100644 --- a/networking/tftp.c +++ b/networking/tftp.c @@ -258,6 +258,8 @@ static int tftp_protocol( } if (!ENABLE_TFTP || our_lsa) { +/* gcc 4.3.1 would NOT optimize it out as it should! */ +#if ENABLE_FEATURE_TFTP_BLOCKSIZE if (blksize != TFTP_BLKSIZE_DEFAULT || tsize) { /* Create and send OACK packet. */ /* For the download case, block_nr is still 1 - @@ -266,6 +268,7 @@ static int tftp_protocol( opcode = TFTP_OACK; goto add_blksize_opt; } +#endif } else { /* Removing it, or using if() statement instead of #if may lead to * "warning: null argument where non-null required": */ @@ -301,6 +304,7 @@ static int tftp_protocol( strcpy(cp, "octet"); cp += sizeof("octet"); +#if ENABLE_FEATURE_TFTP_BLOCKSIZE if (blksize == TFTP_BLKSIZE_DEFAULT) goto send_pkt; @@ -309,9 +313,11 @@ static int tftp_protocol( bb_error_msg("remote filename is too long"); goto ret; } - USE_FEATURE_TFTP_BLOCKSIZE(want_option_ack = 1;) + want_option_ack = 1; +#endif #endif /* ENABLE_TFTP */ +#if ENABLE_FEATURE_TFTP_BLOCKSIZE add_blksize_opt: #if ENABLE_TFTPD if (tsize) { @@ -329,6 +335,7 @@ static int tftp_protocol( cp += sizeof("blksize"); cp += snprintf(cp, 6, "%d", blksize) + 1; } +#endif /* First packet is built, so skip packet generation */ goto send_pkt; } |