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>
(cherry picked from commit 965a808b91)
v3.5.13-sru
OBATA Akio 4 years ago committed by Slávek Banko
parent 3242ddae6c
commit b92175e2a3
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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