diff --git a/src/util/u_process.c b/src/util/u_process.c index 992ed0e718d..9f847d1cc02 100644 --- a/src/util/u_process.c +++ b/src/util/u_process.c @@ -46,8 +46,6 @@ #if defined(__linux__) && defined(HAVE_PROGRAM_INVOCATION_NAME) -#include "debug.h" - static char *path = NULL; static void __freeProgramPath() @@ -68,7 +66,7 @@ __getProgramName() * Strip these arguments out by using the realpath only if it was * a prefix of the invocation name. */ - do_once { + if (!path) { path = realpath("/proc/self/exe", NULL); atexit(__freeProgramPath); }