svn commit: trunk/busybox/networking
vda at busybox.net
vda at busybox.net
Mon Jun 16 07:32:41 UTC 2008
Author: vda
Date: 2008-06-16 00:32:40 -0700 (Mon, 16 Jun 2008)
New Revision: 22366
Log:
tftp: help compiler a bit
Modified:
trunk/busybox/networking/tftp.c
Changeset:
Modified: trunk/busybox/networking/tftp.c
===================================================================
--- trunk/busybox/networking/tftp.c 2008-06-16 07:15:44 UTC (rev 22365)
+++ trunk/busybox/networking/tftp.c 2008-06-16 07:32:40 UTC (rev 22366)
@@ -258,6 +258,8 @@
}
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 @@
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 @@
strcpy(cp, "octet");
cp += sizeof("octet");
+#if ENABLE_FEATURE_TFTP_BLOCKSIZE
if (blksize == TFTP_BLKSIZE_DEFAULT)
goto send_pkt;
@@ -309,9 +313,11 @@
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 @@
cp += sizeof("blksize");
cp += snprintf(cp, 6, "%d", blksize) + 1;
}
+#endif
/* First packet is built, so skip packet generation */
goto send_pkt;
}
More information about the busybox-cvs
mailing list