Re: [Libguestfs] [PATCH 4/5] macosx/bsd: Use getprogname() where available

Richard W.M. Jones
2015-02-11T13:52:33Z

On Mon, Feb 09, 2015 at 11:06:18AM +0000, Margaret Lewicka
wrote:
> ---
>  configure.ac                    | 1 +
>  src/guestfs-internal-frontend.h | 2 ++
>  2 files changed, 3 insertions(+)
>
> diff --git a/configure.ac b/configure.ac
> index a2fb99e..0f7f97e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -315,6 +315,7 @@ AC_CHECK_FUNCS([\
>      be32toh \
>      fsync \
>      futimens \
> +    getprogname \
>      getxattr \
>      htonl \
>      htons \
> diff --git a/src/guestfs-internal-frontend.h
b/src/guestfs-internal-frontend.h
> index 2b9070b..d496655 100644
> --- a/src/guestfs-internal-frontend.h
> +++ b/src/guestfs-internal-frontend.h
> @@ -133,6 +133,8 @@ extern void guestfs___cleanup_pclose (void *ptr);
>   */
>  #if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME == 1
>  #  define guestfs___program_name program_invocation_short_name
> +#elif HAVE_GETPROGNAME
> +#  define guestfs___program_name getprogname()
>  #else
>  #  define guestfs___program_name "libguestfs"
>  #endif
> --

Thanks, ACKed and pushed.

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch