From: Lennart Poettering Date: Mon, 5 Feb 2007 21:39:17 +0000 (+0000) Subject: macosx portability: use GLOB_xxx macros only if they are available X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=e0503b96e4429204bfe60b873ba244d4a92765af;p=catta macosx portability: use GLOB_xxx macros only if they are available git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1387 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-daemon/static-services.c b/avahi-daemon/static-services.c index 4df6047..b9a852c 100644 --- a/avahi-daemon/static-services.c +++ b/avahi-daemon/static-services.c @@ -684,20 +684,25 @@ void static_service_load(int in_chroot) { } memset(&globbuf, 0, sizeof(globbuf)); + if ((globret = glob(in_chroot ? "/services/*.service" : AVAHI_SERVICE_DIR "/*.service", GLOB_ERR, NULL, &globbuf)) != 0) + switch (globret) { +#ifdef GLOB_NOSPACE case GLOB_NOSPACE: - avahi_log_error("Not enough memory to read service directory."); + avahi_log_error("Not enough memory to read service directory "AVAHI_SERVICE_DIR"."); break; - - case GLOB_ABORTED: - avahi_log_error("Failed to read %s.", AVAHI_SERVICE_DIR); - break; - +#endif +#ifdef GLOB_NOMATCH case GLOB_NOMATCH: - avahi_log_info("No service found in %s.", AVAHI_SERVICE_DIR); + avahi_log_info("No service file found in "AVAHI_SERVICE_DIR"."); + break; +#endif + default: + avahi_log_error("Failed to read "AVAHI_SERVICE_DIR"."); break; - } + } + else { for (p = globbuf.gl_pathv; *p; p++) load_file(*p);