summaryrefslogtreecommitdiffstats
path: root/src/intel/tools
diff options
context:
space:
mode:
authorJonathan Gray <[email protected]>2016-09-02 03:12:26 +1000
committerEmil Velikov <[email protected]>2016-09-08 18:37:02 +0100
commitd50c56f8687036fdb345d6def3262fd0929a04ad (patch)
tree8c9ce72ece7c88d7398c990cf6fa0077e681d0d8 /src/intel/tools
parent2d3ebb474c3056610f19c44e5c62d42c2de6b31b (diff)
aubinator: only use program_invocation_short_name with glibc/cygwin
program_invocation_short_name is a gnu extension. Limit use of it to glibc and cygwin and otherwise use getprogname() which is available on BSD and OS X. Signed-off-by: Jonathan Gray <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/intel/tools')
-rw-r--r--src/intel/tools/aubinator.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
index df844692b05..fe1f369ec21 100644
--- a/src/intel/tools/aubinator.c
+++ b/src/intel/tools/aubinator.c
@@ -1014,6 +1014,12 @@ setup_pager(void)
static void
print_help(FILE *file)
{
+ const char *progname;
+#if defined(__GLIBC__) || defined(__CYGWIN__)
+ progname = program_invocation_short_name;
+#else
+ progname = getprogname();
+#endif
fprintf(file,
"Usage: %s [OPTION]... FILE\n"
"Decode aub file contents.\n\n"
@@ -1025,7 +1031,7 @@ print_help(FILE *file)
" if omitted), 'always', or 'never'\n"
" --no-pager don't launch pager\n"
" --no-offsets don't print instruction offsets\n",
- basename(program_invocation_name));
+ basename(progname));
}
static bool