[PATCH 2/5] Replace program_invocation_short_name with prog_name from command line
Jeevaka Prabu Badrappan
jeevaka.badrappan at intel.com
Tue Apr 29 20:39:16 UTC 2025
program_invocation_short_name is global variable provided by glibc.
Inorder to get the igt built for Android(without glibc), replaced the
program_invocation_short_name with the prog_name.
Signed-off-by: Jeevaka Prabu Badrappan <jeevaka.badrappan at intel.com>
---
tools/gputop.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/gputop.c b/tools/gputop.c
index 43b01f566..ef868f670 100644
--- a/tools/gputop.c
+++ b/tools/gputop.c
@@ -335,7 +335,7 @@ struct gputop_args {
unsigned long delay_usec;
};
-static void help(void)
+static void help(char* prog_name)
{
printf("Usage:\n"
"\t%s [options]\n\n"
@@ -343,7 +343,7 @@ static void help(void)
"\t-h, --help show this help\n"
"\t-d, --delay =SEC[.TENTHS] iterative delay as SECS [.TENTHS]\n"
"\t-n, --iterations =NUMBER number of executions\n"
- , program_invocation_short_name);
+ , prog_name);
}
static int parse_args(int argc, char * const argv[], struct gputop_args *args)
@@ -384,7 +384,7 @@ static int parse_args(int argc, char * const argv[], struct gputop_args *args)
}
break;
case 'h':
- help();
+ help(argv[0]);
return 0;
default:
fprintf(stderr, "Unkonwn option '%c'.\n", c);
--
2.49.0
More information about the igt-dev
mailing list