diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-02-04 18:32:21 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-02-04 18:32:21 +0100 |
commit | 565af2322271984edf6eb533f90789e52e311848 (patch) | |
tree | 76c8f1ad68ae213e0f4d88ef7fbf2ba11cb2160e | |
parent | 2598915d43d7403e72d312ac426e585499e94173 (diff) | |
download | busybox-w32-565af2322271984edf6eb533f90789e52e311848.tar.gz busybox-w32-565af2322271984edf6eb533f90789e52e311848.tar.bz2 busybox-w32-565af2322271984edf6eb533f90789e52e311848.zip |
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.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/networking/ftpd.c b/networking/ftpd.c index 8af5acac2..833507ba1 100644 --- a/networking/ftpd.c +++ b/networking/ftpd.c | |||
@@ -171,9 +171,13 @@ struct globals { | |||
171 | char msg_ok [(sizeof("NNN " MSG_OK ) + 3) & 0xfffc]; | 171 | char msg_ok [(sizeof("NNN " MSG_OK ) + 3) & 0xfffc]; |
172 | char msg_err[(sizeof("NNN " MSG_ERR) + 3) & 0xfffc]; | 172 | char msg_err[(sizeof("NNN " MSG_ERR) + 3) & 0xfffc]; |
173 | } FIX_ALIASING; | 173 | } FIX_ALIASING; |
174 | #define G (*(struct globals*)bb_common_bufsiz1) | 174 | #define G (*ptr_to_globals) |
175 | /* ^^^ about 75 bytes smaller code than this: */ | ||
176 | //#define G (*(struct globals*)bb_common_bufsiz1) | ||
175 | #define INIT_G() do { \ | 177 | #define INIT_G() do { \ |
176 | setup_common_bufsiz(); \ | 178 | SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \ |
179 | /*setup_common_bufsiz();*/ \ | ||
180 | \ | ||
177 | /* Moved to main */ \ | 181 | /* Moved to main */ \ |
178 | /*strcpy(G.msg_ok + 4, MSG_OK );*/ \ | 182 | /*strcpy(G.msg_ok + 4, MSG_OK );*/ \ |
179 | /*strcpy(G.msg_err + 4, MSG_ERR);*/ \ | 183 | /*strcpy(G.msg_err + 4, MSG_ERR);*/ \ |