From: Lennart Poettering Date: Wed, 9 Nov 2005 17:16:55 +0000 (+0000) Subject: simplify some lines X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=114645560ccb137345760502cff17bf26257a09e;p=catta simplify some lines git-svn-id: file:///home/lennart/svn/public/avahi/trunk@942 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-compat-libdns_sd/warn.c b/avahi-compat-libdns_sd/warn.c index 0f7f6dc..8d766c3 100644 --- a/avahi-compat-libdns_sd/warn.c +++ b/avahi-compat-libdns_sd/warn.c @@ -59,11 +59,8 @@ const char *avahi_exe_name(void) { if (exe_name[0] == 0) { int k; - char fn[64]; - snprintf(fn, sizeof(fn), "/proc/%lu/exe", (unsigned long) getpid()); - - if ((k = readlink(fn, exe_name, sizeof(exe_name)-1)) < 0) + if ((k = readlink("/proc/self/exe", exe_name, sizeof(exe_name)-1)) < 0) snprintf(exe_name, sizeof(exe_name), "(unknown)"); else { char *slash; @@ -132,6 +129,3 @@ void avahi_warn_unsupported(const char *function) { avahi_warn("Please fix your application to use the native API of Avahi!"); avahi_warn("For more information see ", avahi_exe_name(), function); } - - -