git: 994eb2fb8a90 - stable/13 - ctfdump: Use getprogname()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 26 Feb 2023 01:54:58 UTC
The branch stable/13 has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=994eb2fb8a901c883f2bd24fa29c6cd513cb4340
commit 994eb2fb8a901c883f2bd24fa29c6cd513cb4340
Author: Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2023-02-23 16:28:35 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2023-02-26 01:53:15 +0000
ctfdump: Use getprogname()
Also remove no longer used function `getpname()`.
Reviewed by: markj
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D38740
(cherry picked from commit 3dd5524264095ed8612c28908e13f80668eff2f9)
---
cddl/contrib/opensolaris/tools/ctf/common/utils.c | 24 -----------------------
cddl/contrib/opensolaris/tools/ctf/dump/dump.c | 2 +-
2 files changed, 1 insertion(+), 25 deletions(-)
diff --git a/cddl/contrib/opensolaris/tools/ctf/common/utils.c b/cddl/contrib/opensolaris/tools/ctf/common/utils.c
index f74eb8de40fa..fda29486d94b 100644
--- a/cddl/contrib/opensolaris/tools/ctf/common/utils.c
+++ b/cddl/contrib/opensolaris/tools/ctf/common/utils.c
@@ -35,30 +35,6 @@
/*LINTLIBRARY*/
-static const char *pname;
-
-#pragma init(getpname)
-const char *
-getpname(void)
-{
- const char *p, *q;
-
- if (pname != NULL)
- return (pname);
-
- if ((p = getexecname()) != NULL)
- q = strrchr(p, '/');
- else
- q = NULL;
-
- if (q == NULL)
- pname = p;
- else
- pname = q + 1;
-
- return (pname);
-}
-
void
vdie(const char *format, va_list alist)
{
diff --git a/cddl/contrib/opensolaris/tools/ctf/dump/dump.c b/cddl/contrib/opensolaris/tools/ctf/dump/dump.c
index 06c00a7b0e7f..5cbf46af1b73 100644
--- a/cddl/contrib/opensolaris/tools/ctf/dump/dump.c
+++ b/cddl/contrib/opensolaris/tools/ctf/dump/dump.c
@@ -856,7 +856,7 @@ print_stats(void)
static int
print_usage(FILE *fp, int verbose)
{
- (void) fprintf(fp, "Usage: %s [-dfhlsSt] [-u file] file\n", getpname());
+ (void) fprintf(fp, "Usage: %s [-dfhlsSt] [-u file] file\n", getprogname());
if (verbose) {
(void) fprintf(fp,