diff options
author | OBATA Akio <obache@wizdas.com> | 2020-08-17 18:10:50 +0900 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2021-02-03 22:38:58 +0100 |
commit | b92175e2a345f29e4ac9af7680b4799a14662644 (patch) | |
tree | 31dfd4f5f3044e4c6a2341de74e3f239c05ce545 | |
parent | 3242ddae6c6233ba633bdbfcc1677dbd2630d57d (diff) | |
download | tdelibs-b92175e2a345f29e4ac9af7680b4799a14662644.tar.gz tdelibs-b92175e2a345f29e4ac9af7680b4799a14662644.zip |
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 965a808b91b6542208b24af18e55193e5f929c37)
-rw-r--r-- | kio/kio/connection.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kio/kio/connection.cpp b/kio/kio/connection.cpp index 725a85f13..90696da4c 100644 --- a/kio/kio/connection.cpp +++ b/kio/kio/connection.cpp @@ -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 |