Get proper program name on BSD.

This commit is contained in:
Bartosz Taudul 2019-11-21 02:16:12 +01:00
parent 7940977dba
commit c79449a6a1

View File

@ -250,7 +250,7 @@ static const char* GetProcessName()
# endif # endif
#elif defined _GNU_SOURCE || defined __CYGWIN__ #elif defined _GNU_SOURCE || defined __CYGWIN__
processName = program_invocation_short_name; processName = program_invocation_short_name;
#elif defined __APPLE__ #elif defined __APPLE__ || defined BSD
auto buf = getprogname(); auto buf = getprogname();
if( buf ) processName = buf; if( buf ) processName = buf;
#endif #endif