From: Sebastien Estienne Date: Mon, 14 Nov 2005 22:26:06 +0000 (+0000) Subject: * implement avahi_exe_name for BSD/Darwin X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=56d97acfa37cbf4cfe2a038f76dcc00ea63c9149;p=catta * implement avahi_exe_name for BSD/Darwin * no more sebest in the TOO :) git-svn-id: file:///home/lennart/svn/public/avahi/trunk@961 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-compat-libdns_sd/warn.c b/avahi-compat-libdns_sd/warn.c index 8d766c3..13586ef 100644 --- a/avahi-compat-libdns_sd/warn.c +++ b/avahi-compat-libdns_sd/warn.c @@ -46,9 +46,10 @@ static pthread_mutex_t linkage_mutex = PTHREAD_MUTEX_INITIALIZER; static int linkage_warning = 0; -#ifdef __linux__ - const char *avahi_exe_name(void) { +#ifdef HAVE_GETPROGNAME + return getprogname(); +#elif defined(__linux__) static char exe_name[1024] = ""; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; @@ -76,19 +77,13 @@ const char *avahi_exe_name(void) { pthread_mutex_unlock(&mutex); return exe_name; -} - #else - #ifdef __GNUC__ #warning "avahi_exe_name() needs to be implemented for your operating system" #endif - -const char *avahi_exe_name(void) { return "(unknown)"; -} - #endif +} void avahi_warn(const char *fmt, ...) { char msg[512] = "*** WARNING *** "; diff --git a/configure.ac b/configure.ac index 88ab3a5..6b83eed 100644 --- a/configure.ac +++ b/configure.ac @@ -206,7 +206,7 @@ AC_FUNC_MEMCMP AC_FUNC_SELECT_ARGTYPES AC_FUNC_MALLOC AC_FUNC_REALLOC -AC_CHECK_FUNCS([gethostname memchr memmove memset mkdir select socket strchr strcspn strdup strerror strrchr strspn strstr uname setresuid setreuid setresgid setregid strcasecmp gettimeofday putenv strncasecmp strlcpy gethostbyname seteuid setegid setproctitle]) +AC_CHECK_FUNCS([gethostname memchr memmove memset mkdir select socket strchr strcspn strdup strerror strrchr strspn strstr uname setresuid setreuid setresgid setregid strcasecmp gettimeofday putenv strncasecmp strlcpy gethostbyname seteuid setegid setproctitle getprogname]) AC_FUNC_CHOWN AC_FUNC_STAT diff --git a/docs/TODO b/docs/TODO index 9b77006..46cb036 100644 --- a/docs/TODO +++ b/docs/TODO @@ -4,7 +4,6 @@ for 0.6: * Expose AvahiSRecordBrowser over D-BUS and implement in avahi-client [lathiat] * fix python scripts * update man pages -* portability: implement avahi_exe_name() in avahi-compat-libdns_sd/warn.c on non-linux architectures [sebest] later: * add simplification routine for adding services