X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-daemon%2Fsimple-protocol.c;h=8aa427b86639d1fd7f1a6b683acb656e2e446902;hb=3f8227311e734f408e34d114be975f400b20c989;hp=aa81cd75974cc1171833866c669c8eb8b58b3e41;hpb=3adbda2cd5be48b7c630325f0f92e315d7eb2cfb;p=catta diff --git a/avahi-daemon/simple-protocol.c b/avahi-daemon/simple-protocol.c index aa81cd7..8aa427b 100644 --- a/avahi-daemon/simple-protocol.c +++ b/avahi-daemon/simple-protocol.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -35,12 +36,18 @@ #include #include #include + #include #include +#include #include "simple-protocol.h" #include "main.h" +#ifdef ENABLE_CHROOT +#include "chroot.h" +#endif + #define BUFFER_SIZE (20*1024) #define CLIENTS_MAX 50 @@ -165,13 +172,13 @@ static void client_output_printf(Client *c, const char *format, ...) { } static void host_name_resolver_callback( - AvahiSHostNameResolver *r, + AVAHI_GCC_UNUSED AvahiSHostNameResolver *r, AvahiIfIndex iface, AvahiProtocol protocol, AvahiResolverEvent event, const char *hostname, const AvahiAddress *a, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void* userdata) { Client *c = userdata; @@ -190,13 +197,13 @@ static void host_name_resolver_callback( } static void address_resolver_callback( - AvahiSAddressResolver *r, + AVAHI_GCC_UNUSED AvahiSAddressResolver *r, AvahiIfIndex iface, AvahiProtocol protocol, AvahiResolverEvent event, - const AvahiAddress *a, + AVAHI_GCC_UNUSED const AvahiAddress *a, const char *hostname, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void* userdata) { Client *c = userdata; @@ -212,14 +219,14 @@ static void address_resolver_callback( } static void dns_server_browser_callback( - AvahiSDNSServerBrowser *b, + AVAHI_GCC_UNUSED AvahiSDNSServerBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, - const char *host_name, + AVAHI_GCC_UNUSED const char *host_name, const AvahiAddress *a, uint16_t port, - AvahiLookupResultFlags flags, + AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void* userdata) { Client *c = userdata; @@ -368,7 +375,7 @@ static void handle_input(Client *c) { } } -static void client_work(AvahiWatch *watch, int fd, AvahiWatchEvent events, void *userdata) { +static void client_work(AvahiWatch *watch, AVAHI_GCC_UNUSED int fd, AvahiWatchEvent events, void *userdata) { Client *c = userdata; assert(c); @@ -416,7 +423,7 @@ static void client_work(AvahiWatch *watch, int fd, AvahiWatchEvent events, void (c->inbuf_length < sizeof(c->inbuf) ? AVAHI_WATCH_IN : 0)); } -static void server_work(AvahiWatch *watch, int fd, AvahiWatchEvent events, void *userdata) { +static void server_work(AVAHI_GCC_UNUSED AvahiWatch *watch, int fd, AvahiWatchEvent events, void *userdata) { Server *s = userdata; assert(s); @@ -494,7 +501,11 @@ void simple_protocol_shutdown(void) { if (server) { if (server->bind_successful) +#ifdef ENABLE_CHROOT + avahi_chroot_helper_unlink(AVAHI_SOCKET); +#else unlink(AVAHI_SOCKET); +#endif while (server->clients) client_free(server->clients);