mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-03-19 07:43:00 +01:00
Use getexecname() if available for getprogname()
This function is present on Solaris.
This commit is contained in:
parent
abf14c3940
commit
b5cc17d664
@ -37,6 +37,7 @@ AC_TYPE_SIZE_T
|
|||||||
AC_TYPE_SSIZE_T
|
AC_TYPE_SSIZE_T
|
||||||
|
|
||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
|
AC_CHECK_FUNCS([getexecname])
|
||||||
|
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2006 Robert Millan
|
* Copyright © 2006 Robert Millan
|
||||||
* Copyright © 2010-2011 Guillem Jover
|
* Copyright © 2010-2012 Guillem Jover <guillem@hadrons.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@ -41,6 +41,10 @@ getprogname(void)
|
|||||||
#ifdef __GLIBC__
|
#ifdef __GLIBC__
|
||||||
if (__progname == NULL)
|
if (__progname == NULL)
|
||||||
__progname = program_invocation_short_name;
|
__progname = program_invocation_short_name;
|
||||||
|
#elif defined(HAVE_GETEXECNAME)
|
||||||
|
/* getexecname(3) returns an absolute pathname, normalize it. */
|
||||||
|
if (__progname == NULL)
|
||||||
|
setprogname(getexecname());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return __progname;
|
return __progname;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user