summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2018-02-04 18:32:21 +0100
committerDenys Vlasenko2018-02-04 18:32:21 +0100
commit565af2322271984edf6eb533f90789e52e311848 (patch)
tree76c8f1ad68ae213e0f4d88ef7fbf2ba11cb2160e
parent2598915d43d7403e72d312ac426e585499e94173 (diff)
downloadbusybox-565af2322271984edf6eb533f90789e52e311848.zip
busybox-565af2322271984edf6eb533f90789e52e311848.tar.gz
ftpd: switch to mallced "globals"
function old new delta cmdio_write_ok 45 49 +4 cmdio_write_error 45 49 +4 handle_dir_common 360 363 +3 handle_cwd 40 43 +3 port_or_pasv_was_seen 37 39 +2 pasv_active 13 15 +2 cmdio_write_raw 34 36 +2 cmdio_write 78 80 +2 get_remote_transfer_fd 94 93 -1 port_pasv_cleanup 50 45 -5 bind_for_passive_mode 124 119 -5 cmdio_get_cmd_and_arg 237 230 -7 timeout_handler 104 93 -11 ftpd_main 2222 2152 -70 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 8/6 up/down: 22/-99) Total: -77 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/ftpd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/networking/ftpd.c b/networking/ftpd.c
index 8af5aca..833507b 100644
--- a/networking/ftpd.c
+++ b/networking/ftpd.c
@@ -171,9 +171,13 @@ struct globals {
char msg_ok [(sizeof("NNN " MSG_OK ) + 3) & 0xfffc];
char msg_err[(sizeof("NNN " MSG_ERR) + 3) & 0xfffc];
} FIX_ALIASING;
-#define G (*(struct globals*)bb_common_bufsiz1)
+#define G (*ptr_to_globals)
+/* ^^^ about 75 bytes smaller code than this: */
+//#define G (*(struct globals*)bb_common_bufsiz1)
#define INIT_G() do { \
- setup_common_bufsiz(); \
+ SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
+ /*setup_common_bufsiz();*/ \
+ \
/* Moved to main */ \
/*strcpy(G.msg_ok + 4, MSG_OK );*/ \
/*strcpy(G.msg_err + 4, MSG_ERR);*/ \