Skip to content

Instantly share code, notes, and snippets.

@shulima
Last active August 29, 2015 14:17
Show Gist options
  • Save shulima/b232a15b8ff877f817bd to your computer and use it in GitHub Desktop.
Save shulima/b232a15b8ff877f817bd to your computer and use it in GitHub Desktop.
Use getprogname where available
diff --git a/configure b/configure
index 61c715d..1724ba2 100755
--- a/configure
+++ b/configure
@@ -50323,6 +50323,7 @@ for ac_func in \
be32toh \
fsync \
futimens \
+ getprogname \
getxattr \
htonl \
htons \
diff --git a/src/guestfs-internal-frontend.h b/src/guestfs-internal-frontend.h
index 9316421..9706df6 100644
--- a/src/guestfs-internal-frontend.h
+++ b/src/guestfs-internal-frontend.h
@@ -166,6 +166,8 @@ extern GUESTFS_DLL_PUBLIC int guestfs___add_libvirt_dom (guestfs_h *g, virDomain
*/
#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment