git: 83d88726ce26 - releng/13.2 - ctfdump: Use getprogname()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 02 Mar 2023 08:29:00 UTC
The branch releng/13.2 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=83d88726ce267979e320e03270710d11e4f210d9 commit 83d88726ce267979e320e03270710d11e4f210d9 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2023-02-23 16:28:35 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2023-03-02 08:12:15 +0000 ctfdump: Use getprogname() Also remove no longer used function `getpname()`. Reviewed by: markj Approved by: re (delphij) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D38740 (cherry picked from commit 3dd5524264095ed8612c28908e13f80668eff2f9) (cherry picked from commit 994eb2fb8a901c883f2bd24fa29c6cd513cb4340) ctf: Remove unused function prototype for getpname() (cherry picked from commit f8e1aa85fed08d5f689cb36d65a76d191f6500dd) (cherry picked from commit eba26d0ba37e647572b3ec285352f778ef0ec9f0) --- cddl/contrib/opensolaris/tools/ctf/common/utils.c | 24 ----------------------- cddl/contrib/opensolaris/tools/ctf/common/utils.h | 2 -- cddl/contrib/opensolaris/tools/ctf/dump/dump.c | 2 +- 3 files changed, 1 insertion(+), 27 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/common/utils.h b/cddl/contrib/opensolaris/tools/ctf/common/utils.h index 99378bb4f251..6918bdab89aa 100644 --- a/cddl/contrib/opensolaris/tools/ctf/common/utils.h +++ b/cddl/contrib/opensolaris/tools/ctf/common/utils.h @@ -42,8 +42,6 @@ extern "C" { extern void vdie(const char *, va_list); extern void die(const char *, ...); -extern const char *getpname(void); - #ifdef __cplusplus } #endif 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,