summaryrefslogtreecommitdiffstats
path: root/pcp-htop.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2023-04-04 16:47:11 +1000
committerBenBE <BenBE@geshi.org>2023-04-06 00:19:54 +0200
commit14da84f877a0f3627ddaea836c9537b2292fa22d (patch)
treed8eff482c76709187482e41eb36628b5de935078 /pcp-htop.c
parente7f447b6a3473a572d3e6c191128f1796477860d (diff)
Refactor to use a program name pointer instead of PACKAGE macro
During SEGV handling under pcp-htop several incorrect strings were observed - in particular reporting htop as the binary name instead of pcp-htop. This is something we want to be crystal clear on when we request user stack traces etc, so make sure this cannot be done incorrectly.
Diffstat (limited to 'pcp-htop.c')
-rw-r--r--pcp-htop.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pcp-htop.c b/pcp-htop.c
index 2713c896..ed585ecb 100644
--- a/pcp-htop.c
+++ b/pcp-htop.c
@@ -14,13 +14,14 @@ in the source distribution for its full text.
#include "Platform.h"
+const char* program = "pcp-htop";
+
int main(int argc, char** argv) {
- const char* name = "pcp-htop";
- pmSetProgname(name);
+ pmSetProgname(program);
/* extract environment variables */
opts.flags |= PM_OPTFLAG_ENV_ONLY;
(void)pmGetOptions(argc, argv, &opts);
- return CommandLine_run(name, argc, argv);
+ return CommandLine_run(argc, argv);
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy