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);
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;
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);
}
if (!XML_ParseBuffer(parser, n, n == 0)) {
- avahi_log_error("XML_ParseBuffer() failed at line %d: %s.\n", XML_GetCurrentLineNumber(parser), XML_ErrorString(XML_GetErrorCode(parser)));
+ avahi_log_error("XML_ParseBuffer() failed at line %d: %s.\n", (int) XML_GetCurrentLineNumber(parser), XML_ErrorString(XML_GetErrorCode(parser)));
goto finish;
}
}
}
-void static_service_load(void) {
+void static_service_load(int in_chroot) {
StaticServiceGroup *g, *n;
glob_t globbuf;
char **p;
}
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++)