summaryrefslogtreecommitdiffstats
path: root/avahi-compat-libdns_sd
diff options
context:
space:
mode:
authorSebastien Estienne <sebastien.estienne@gmail.com>2005-11-14 22:26:06 +0000
committerSebastien Estienne <sebastien.estienne@gmail.com>2005-11-14 22:26:06 +0000
commit56d97acfa37cbf4cfe2a038f76dcc00ea63c9149 (patch)
tree952eb0e34cab95f216915dafd7187d2b6cd10be1 /avahi-compat-libdns_sd
parent20c18433ce13ec9ecaa22e68171a34f3aff0e71e (diff)
* 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
Diffstat (limited to 'avahi-compat-libdns_sd')
-rw-r--r--avahi-compat-libdns_sd/warn.c13
1 files changed, 4 insertions, 9 deletions
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 *** ";