Improve progname detection portability

`getprogname()` of FreeBSD is based on NetBSD's one, no reason to
prevent using it on NetBSD.
glibc also has own special variable for progname.

Signed-off-by: OBATA Akio <obache@wizdas.com>
pull/99/head
OBATA Akio 4 years ago committed by TDE Gitea
parent 6886dd7e96
commit 965a808b91

@ -42,8 +42,10 @@
#include <kdebug.h>
#include <tqsocketnotifier.h>
#if defined(__OpenBSD__) || defined(__FreeBSD__)
#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
#define __progname getprogname()
#elif defined(_GNU_SOURCE) && defined(__GLIBC__)
#define __progname program_invocation_short_name
#else
extern char *__progname;
#endif

Loading…
Cancel
Save