From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 24EF741E04; Tue, 7 Mar 2023 17:53:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15E2540ED6; Tue, 7 Mar 2023 17:53:25 +0100 (CET) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mails.dpdk.org (Postfix) with ESMTP id 294064067B for ; Tue, 7 Mar 2023 17:53:23 +0100 (CET) Received: by mail-pl1-f178.google.com with SMTP id h8so14755228plf.10 for ; Tue, 07 Mar 2023 08:53:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678208002; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=a6iM6d2qhKi5zO4NQa1ic+TfUnh8nXCMgf1vt/tvtBo=; b=dI92rRLf3KpodEfmLNxI6ErMyIwwhVdgSlDX+YuEUeMSiks47o1mLsO8THvHTEzQWB Q8vJZkAQ/vVaeMQqYdTMjIQFDkCEOyi+E8OGRO6EWpTglZXXJ/lGffsNjFKvsRJQZ/Rs wKxkDCTH2xZsihzqk2F+ATTEmizsaaftim1uqB6n5+AgBoFr4ABX2r6Krzpl2mIBh3hY yUAYosYRwMv376eRLIwI31W/07TJjbHePqG/58C084KEtUD7T9XeTU3bYnuJYZN6flJj fmM03XKxr8gpFvG/Hf5lGA12HCdybyCbji/PmeQYlHPMHcN5oCaH6rtgqmBwIy31Cr/d YX6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678208002; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=a6iM6d2qhKi5zO4NQa1ic+TfUnh8nXCMgf1vt/tvtBo=; b=IOA0ysRUnIAzHpaX0DYOyKIF/UUlI70iC941YIuxQIBgDBSKNIpaN6wM8VhdrUthHi Wrby348z/LMWd0SQNwb8R0y6SZxQJJ0qbkq/6wSxtyPped8ExhMYpM7aERVeTlFE99ec 0GuDd7DdUxGYhYt0InqiyZhnuiY/n/sBBm8vVZEl24zzaN72l33QscJHgE/rMt7SilQN LPoNqzlQREWEABkswdL+VM5b5h55qEdvlLLCrgKyaKs9l/634m2orRhz/oJhJZvbp9H0 FRF0AZVV8zT89gIELaMWJFKzlbqg+3Jg2oTSiVb1lkg8Poy88ZK0gDErai8qsxJR9rnF q8Eg== X-Gm-Message-State: AO0yUKVfFmRrlPyJFlP9LijSo+RtxtOWQQYL7P1lg2iGlY4UETLfoJqP gkSnNSapIfVQ3PZlrbDCg+1O7GAWxXTka3fiBwOf0A== X-Google-Smtp-Source: AK7set+IFvIz1UWjh0bP+U3fLQFpexEXAtumCuSCpXJ54Yg+5XImEyekalf8Z+DrEQ/rrVDEJ5K8Mg== X-Received: by 2002:a17:90b:2247:b0:234:a9df:db9b with SMTP id hk7-20020a17090b224700b00234a9dfdb9bmr15003939pjb.13.1678208001942; Tue, 07 Mar 2023 08:53:21 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id fu11-20020a17090ad18b00b002340d317f3esm7653161pjb.52.2023.03.07.08.53.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 08:53:21 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH] eal: use program_invocation_short_name Date: Tue, 7 Mar 2023 08:53:19 -0800 Message-Id: <20230307165319.68767-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Glibc already has a documented variable with the program name so use it instead of computing the value. Signed-off-by: Stephen Hemminger --- lib/eal/linux/eal.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index fabafbc39bd5..10cef8c90517 100644 --- a/lib/eal/linux/eal.c +++ b/lib/eal/linux/eal.c @@ -968,8 +968,6 @@ rte_eal_init(int argc, char **argv) int i, fctret, ret; static uint32_t run_once; uint32_t has_run = 0; - const char *p; - static char logid[PATH_MAX]; char cpuset[RTE_CPU_AFFINITY_STR_LEN]; char thread_name[RTE_MAX_THREAD_NAME_LEN]; bool phys_addrs; @@ -991,9 +989,6 @@ rte_eal_init(int argc, char **argv) return -1; } - p = strrchr(argv[0], '/'); - strlcpy(logid, p ? p + 1 : argv[0], sizeof(logid)); - eal_reset_internal_config(internal_conf); /* set log level as early as possible */ @@ -1172,7 +1167,8 @@ rte_eal_init(int argc, char **argv) #endif } - if (eal_log_init(logid, internal_conf->syslog_facility) < 0) { + if (eal_log_init(program_invocation_short_name, + internal_conf->syslog_facility) < 0) { rte_eal_init_alert("Cannot init logging."); rte_errno = ENOMEM; __atomic_store_n(&run_once, 0, __ATOMIC_RELAXED); -- 2.39.2