diff options
Diffstat (limited to 'networking/udhcp/dhcpd.c')
-rw-r--r-- | networking/udhcp/dhcpd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c index 238542bb0..093239536 100644 --- a/networking/udhcp/dhcpd.c +++ b/networking/udhcp/dhcpd.c | |||
@@ -45,7 +45,7 @@ | |||
45 | #include "dhcpd.h" | 45 | #include "dhcpd.h" |
46 | 46 | ||
47 | /* globals */ | 47 | /* globals */ |
48 | struct dyn_lease *g_leases; | 48 | #define g_leases ((struct dyn_lease*)ptr_to_globals) |
49 | /* struct server_config_t server_config is in bb_common_bufsiz1 */ | 49 | /* struct server_config_t server_config is in bb_common_bufsiz1 */ |
50 | 50 | ||
51 | /* Takes the address of the pointer to the static_leases linked list, | 51 | /* Takes the address of the pointer to the static_leases linked list, |
@@ -856,8 +856,6 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv) | |||
856 | 856 | ||
857 | /* Make sure fd 0,1,2 are open */ | 857 | /* Make sure fd 0,1,2 are open */ |
858 | bb_sanitize_stdio(); | 858 | bb_sanitize_stdio(); |
859 | /* Equivalent of doing a fflush after every \n */ | ||
860 | setlinebuf(stdout); | ||
861 | 859 | ||
862 | /* Create pidfile */ | 860 | /* Create pidfile */ |
863 | write_pidfile(server_config.pidfile); | 861 | write_pidfile(server_config.pidfile); |
@@ -880,7 +878,9 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv) | |||
880 | server_config.max_leases = num_ips; | 878 | server_config.max_leases = num_ips; |
881 | } | 879 | } |
882 | 880 | ||
883 | g_leases = xzalloc(server_config.max_leases * sizeof(g_leases[0])); | 881 | /* this sets g_leases */ |
882 | SET_PTR_TO_GLOBALS(xzalloc(server_config.max_leases * sizeof(g_leases[0]))); | ||
883 | |||
884 | read_leases(server_config.lease_file); | 884 | read_leases(server_config.lease_file); |
885 | 885 | ||
886 | if (udhcp_read_interface(server_config.interface, | 886 | if (udhcp_read_interface(server_config.interface, |