From e4dbcc0d5d6c9c68a7f3c437611b726f9f0211cf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 28 Dec 2005 03:04:40 +0000 Subject: r12531: 'make quicktest' was taking 15 minutes on my system due to failing DNS lookups in load_interfaces(). The reason was my eth0 interface was down, and it was being interpreted as a DNS name. This patch changes load_interfaces() to happening automatically when interfaces are first needed instead of on the startup of every samba binary. This means that (for example) ldbadd doesn't call load_interfaces(), which means no slow DNS lookups. I also reduced the number of static globals in interface.c to 1, and changed from malloc to talloc When you want to force a reload of the interfaces list, you now call unload_interfaces(), which means the next call that needs the interfaces list will reload it (This used to be commit f79d90bd1364b970adb2981b2572e77066431f1e) --- source4/gtk/tools/gepdump.c | 1 - source4/gtk/tools/gregedit.c | 1 - source4/gtk/tools/gwcrontab.c | 1 - source4/gtk/tools/gwsam.c | 1 - 4 files changed, 4 deletions(-) (limited to 'source4/gtk') diff --git a/source4/gtk/tools/gepdump.c b/source4/gtk/tools/gepdump.c index 622d4b99aa..9275bc1ebd 100644 --- a/source4/gtk/tools/gepdump.c +++ b/source4/gtk/tools/gepdump.c @@ -464,7 +464,6 @@ int main(int argc, char **argv) { gepdump_init_subsystems; lp_load(); - load_interfaces(); setup_logging(argv[0], DEBUG_STDERR); gtk_init(&argc, &argv); diff --git a/source4/gtk/tools/gregedit.c b/source4/gtk/tools/gregedit.c index cb0d927439..f98a366e9b 100644 --- a/source4/gtk/tools/gregedit.c +++ b/source4/gtk/tools/gregedit.c @@ -969,7 +969,6 @@ int main(int argc, char *argv[]) gregedit_init_subsystems; registry_init(); lp_load(); - load_interfaces(); setup_logging(argv[0], DEBUG_STDERR); mem_ctx = talloc_init("gregedit"); diff --git a/source4/gtk/tools/gwcrontab.c b/source4/gtk/tools/gwcrontab.c index fd4f41d06f..391110c56d 100644 --- a/source4/gtk/tools/gwcrontab.c +++ b/source4/gtk/tools/gwcrontab.c @@ -495,7 +495,6 @@ static GtkWidget*create_new_job_dialog (void) { gwcrontab_init_subsystems; lp_load(); - load_interfaces(); setup_logging(argv[0], DEBUG_STDERR); gtk_init(&argc, &argv); diff --git a/source4/gtk/tools/gwsam.c b/source4/gtk/tools/gwsam.c index f1cf8d5e85..963397810c 100644 --- a/source4/gtk/tools/gwsam.c +++ b/source4/gtk/tools/gwsam.c @@ -404,7 +404,6 @@ static GtkWidget* create_mainwindow (void) { gwsam_init_subsystems; lp_load(); - load_interfaces(); setup_logging(argv[0], DEBUG_STDERR); gtk_init(&argc, &argv); -- cgit