summaryrefslogtreecommitdiff
path: root/networking/tftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/tftp.c')
-rw-r--r--networking/tftp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/networking/tftp.c b/networking/tftp.c
index 9aa87d5..eb192d8 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -22,6 +22,8 @@
#include "busybox.h"
+#if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT
+
#define TFTP_BLOCKSIZE_DEFAULT 512 /* according to RFC 1350, don't change */
#define TFTP_TIMEOUT 5 /* seconds */
#define TFTP_NUM_RETRIES 5 /* number of retries */
@@ -56,8 +58,8 @@ static const char *const tftp_bb_error_msg[] = {
#else
#define USE_GETPUT(a) a
/* masks coming from getpot32 */
-#define CMD_GET(cmd) (cmd & 1)
-#define CMD_PUT(cmd) (cmd & 2)
+#define CMD_GET(cmd) ((cmd) & 1)
+#define CMD_PUT(cmd) ((cmd) & 2)
#endif
/* NB: in the code below
* CMD_GET(cmd) and CMD_GET(cmd) are mutually exclusive
@@ -508,3 +510,5 @@ int tftp_main(int argc, char **argv)
}
return result;
}
+
+#endif /* ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT */