1 $NetBSD: patch-src_util_u__process.c,v 1.1 2022/03/13 15:52:50 tnn Exp $
3 atexit() is not a good idea in shared libraries.
5 --- src/util/u_process.c.orig 2021-07-14 20:04:59.260044300 +0000
6 +++ src/util/u_process.c
9 static char *path = NULL;
11 -static void __freeProgramPath()
12 +#if defined(HAVE_NOATEXIT)
13 +static void __attribute__((__destructor__))
25 @@ -68,7 +74,9 @@ __getProgramName()
28 path = realpath("/proc/self/exe", NULL);
29 +#if !defined(HAVE_NOATEXIT)
30 atexit(__freeProgramPath);
34 if (path && strncmp(path, program_invocation_name, strlen(path)) == 0) {