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)
r14.0.x
OBATA Akio 4 years ago committed by Slávek Banko
parent 3dee97b870
commit f31755baa1
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

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

Loading…
Cancel
Save