]> git.meshlink.io Git - catta/blobdiff - avahi-daemon/static-services.c
bump version info
[catta] / avahi-daemon / static-services.c
index 5eba8b2059a8f2461e13a75be9ba91b8eaa65a9e..97cc8b3e77843651d7516b686ad2e14039e25178 100644 (file)
@@ -175,7 +175,7 @@ static void static_service_group_free(StaticServiceGroup *g) {
     avahi_free(g);
 }
 
-static void entry_group_callback(AvahiServer *s, AvahiSEntryGroup *eg, AvahiEntryGroupState state, void* userdata) {
+static void entry_group_callback(AvahiServer *s, AVAHI_GCC_UNUSED AvahiSEntryGroup *eg, AvahiEntryGroupState state, void* userdata) {
     StaticServiceGroup *g = userdata;
     
     assert(s);
@@ -302,6 +302,10 @@ struct xml_userdata {
     char *buf;
 };
 
+#ifndef XMLCALL
+#define XMLCALL
+#endif
+
 static void XMLCALL xml_start(void *data, const char *el, const char *attr[]) {
     struct xml_userdata *u = data;
     
@@ -402,7 +406,7 @@ invalid_attr:
     return;
 }
     
-static void XMLCALL xml_end(void *data, const char *el) {
+static void XMLCALL xml_end(void *data, AVAHI_GCC_UNUSED const char *el) {
     struct xml_userdata *u = data;
     assert(u);
 
@@ -648,7 +652,7 @@ static void load_file(char *n) {
     }
 }
 
-void static_service_load(void) {
+void static_service_load(int in_chroot) {
     StaticServiceGroup *g, *n;
     glob_t globbuf;
     char **p;
@@ -677,7 +681,7 @@ void static_service_load(void) {
     }
 
     memset(&globbuf, 0, sizeof(globbuf));
-    if (glob(AVAHI_SERVICE_DIR "/*.service", GLOB_ERR, NULL, &globbuf) != 0)
+    if (glob(in_chroot ? "/services/*.service" : AVAHI_SERVICE_DIR "/*.service", GLOB_ERR, NULL, &globbuf) != 0)
         avahi_log_error("Failed to read service directory.");
     else {
         for (p = globbuf.gl_pathv; *p; p++)