From nobody Thu Feb 23 16:33:45 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PMz9k04z2z3sC2l; Thu, 23 Feb 2023 16:33:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PMz9j6fgtz3Np4; Thu, 23 Feb 2023 16:33:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677170025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dXSEHeNqUvF+RgZejrcPRwsVivHjPTVGWICXfp0Swjs=; b=bJlv/ejcbHcsM8xgT05yZsm4lJm5vM1ew4+IFsEthSEAklwDD3G/gBSzHATFXBQ2yTeITm v9sNsFWEZ6SrR2Tf6x1pN6H4UNll5tH5+2oxrquGbaFRHeak2vAWPtvTHd89mAdku3bGDe /KonmeAnL8aE9W/XFn2vMs5ZQzJWxVNsJd4UW4AWw2PXrTH3UTQ2eq5WkgZt2qRpu2b6GR SDp6WWY0jK1X5BJBKYeQsXmJoS+EP4TsnxVFTOeZ6CyiGF+MwD6Esx3Gxwq67h3/aJmD8o r2rtI69ZvVAh9Qj4Ve/R4ChxG+8ZQRhopmmu+HE124m4otBLz6vj8g2V8eEkXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677170025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dXSEHeNqUvF+RgZejrcPRwsVivHjPTVGWICXfp0Swjs=; b=x8V+xAvDThMDGXmT4wYPiIBjrTV6pP7khRS/Q0RQPyhSiTH1lJBk8eNq4Q0zea7FgJcpb7 yIpgLn8ppFr+pmTv1lpvceW8yan277kM4E2DjQUn4x3GWgLbHIZCeTodhu/iqVL2LkBeSL Ifhy/1vjZs8YSXPXqYulcci2tHdGRmVxbnXf2kYvF+Pmh684OL2tU6W6/0HaC/FBu/+Qo2 4IiMvqjpNfDPcwyqyPAAufRqMhGSMFda7/w8sPW+sy7xuZIW/UCMg0uvdsZlNmuOd7Q+iH Ak81D5IQXvlbIKWeVaemMVVzTCWudiCxnWGVvbJl5AQHmQdQOtNt20Zm9+2tDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677170025; a=rsa-sha256; cv=none; b=RqTOl/jeOkvG2ForKCrfmTg/2ngWOQO+zcfbMHgVISRawCcgWmoveeeyNBhjwk9ZChsYYg cYRUGmpCEtCzEdmpaYl8vSWSisbTiySZghbOMnblQHIGCYrbK4vSv92O5tfXt3Avr5Oi5P 3g7FuMhGPuiGf+r5jt3o9zleJR8mp6feVdDM6G0abmVPS1g5SjL7tJVmW2zpMsMa7fUjNm G1v0dEw8qGCJL6K7uFssMX2MAhKWZvtYaDJAqc6pmZcY1ZOm3fUMpqhoMssbEXe5JIjzg1 R9D4Ikkfp+mgmu41xJ0klNKLr2Ax1uWhpxg40Omy/TRHZSIs1CWcg0nVn5sKlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PMz9j5hj3zpjx; Thu, 23 Feb 2023 16:33:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31NGXj65061337; Thu, 23 Feb 2023 16:33:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31NGXjAq061336; Thu, 23 Feb 2023 16:33:45 GMT (envelope-from git) Date: Thu, 23 Feb 2023 16:33:45 GMT Message-Id: <202302231633.31NGXjAq061336@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 3dd552426409 - main - ctfdump: Use getprogname() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3dd5524264095ed8612c28908e13f80668eff2f9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3dd5524264095ed8612c28908e13f80668eff2f9 commit 3dd5524264095ed8612c28908e13f80668eff2f9 Author: Zhenlei Huang AuthorDate: 2023-02-23 16:28:35 +0000 Commit: Zhenlei Huang CommitDate: 2023-02-23 16:28:35 +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 --- 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,