aboutsummaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
Diffstat (limited to 'compat')
-rw-r--r--compat/getprogname.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/compat/getprogname.c b/compat/getprogname.c
index ee178b7..a243233 100644
--- a/compat/getprogname.c
+++ b/compat/getprogname.c
@@ -16,8 +16,24 @@
#include "../config.h"
+#ifdef HAVE_PROGRAM_INVOCATION_SHORT_NAME
+
+#include <errno.h>
+
+extern char *program_invocation_short_name;
+
+const char *
+getprogname(void)
+{
+ return program_invocation_short_name;
+}
+
+#else
+
const char *
getprogname(void)
{
return "gmid";
}
+
+#endif