]> git.meshlink.io Git - catta/commitdiff
simplify some lines
authorLennart Poettering <lennart@poettering.net>
Wed, 9 Nov 2005 17:16:55 +0000 (17:16 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 9 Nov 2005 17:16:55 +0000 (17:16 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@942 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-compat-libdns_sd/warn.c

index 0f7f6dc647eeb6c32db710385c10f7e66a96f7b6..8d766c3f9e880727fb9105808eae0ca4585db8ba 100644 (file)
@@ -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 <http://0pointer.de/avahi-compat?s="CGI_SUBSYSTEM"&e=%s&f=%s>", avahi_exe_name(), function);
 }
-
-
-