From 4f0a5e7572a4257894b4bfede42c26d65152609e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 13 Aug 2005 21:25:09 +0000 Subject: * strip glib from avahi-core * implement glib memory allocator * add new documentation file MALLOC * initialize pseudo-RNG from /dev/urandom in avahi-daemon * remove some gcc 4.0 warnings * beef up watch system with real timeouts * move GCC __attribute__ macros into its own header avahi-common/gccmacro.h * make use of GCC's sentinel attribute where it make sense * add malloc() implementations that abort on OOM and enable them by default git-svn-id: file:///home/lennart/svn/public/avahi/trunk@308 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-discover-standalone/Makefile.am | 2 +- avahi-discover-standalone/main.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'avahi-discover-standalone') diff --git a/avahi-discover-standalone/Makefile.am b/avahi-discover-standalone/Makefile.am index 1d54211..dbff50f 100644 --- a/avahi-discover-standalone/Makefile.am +++ b/avahi-discover-standalone/Makefile.am @@ -34,7 +34,7 @@ avahi_discover_standalone_SOURCES = \ main.c avahi_discover_standalone_CFLAGS = $(AM_CFLAGS) -avahi_discover_standalone_LDADD = $(AM_LDADD) ../avahi-core/libavahi-core.la ../avahi-common/libavahi-common.la +avahi_discover_standalone_LDADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-glib/libavahi-glib.la ../avahi-core/libavahi-core.la interfaces = \ avahi-discover.glade diff --git a/avahi-discover-standalone/main.c b/avahi-discover-standalone/main.c index 00984ec..926f4c4 100644 --- a/avahi-discover-standalone/main.c +++ b/avahi-discover-standalone/main.c @@ -29,7 +29,9 @@ #include #include #include -#include +#include +#include +#include struct ServiceType; @@ -268,10 +270,15 @@ int main(int argc, char *argv[]) { AvahiServerConfig config; GtkTreeViewColumn *c; gint error; + AvahiGLibPoll *poll_api; gtk_init(&argc, &argv); glade_init(); + avahi_set_allocator(avahi_glib_allocator()); + + poll_api = avahi_glib_poll_new(NULL); + xml = glade_xml_new(AVAHI_INTERFACES_DIR"avahi-discover.glade", NULL, NULL); main_window = glade_xml_get_widget(xml, "main_window"); g_signal_connect(main_window, "delete-event", (GCallback) main_window_on_delete_event, NULL); @@ -294,7 +301,7 @@ int main(int argc, char *argv[]) { avahi_server_config_init(&config); config.publish_hinfo = config.publish_addresses = config.publish_domain = config.publish_workstation = FALSE; - server = avahi_server_new(NULL, &config, NULL, NULL, &error); + server = avahi_server_new(avahi_glib_poll_get(poll_api), &config, NULL, NULL, &error); avahi_server_config_free(&config); g_assert(server); @@ -304,6 +311,7 @@ int main(int argc, char *argv[]) { gtk_main(); avahi_server_free(server); + avahi_glib_poll_free(poll_api); return 0; } -- cgit