From nobody Wed Dec 01 01:08:26 2021 X-Original-To: dev-commits-src-branches@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 2048F18AE16B; Wed, 1 Dec 2021 01:08:28 +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 4J3gvG3MLSz3sqg; Wed, 1 Dec 2021 01:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 3DD8A2065D; Wed, 1 Dec 2021 01:08:26 +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 1B118QA0035771; Wed, 1 Dec 2021 01:08:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B118QBd035770; Wed, 1 Dec 2021 01:08:26 GMT (envelope-from git) Date: Wed, 1 Dec 2021 01:08:26 GMT Message-Id: <202112010108.1B118QBd035770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0619dbdfde6d - stable/13 - ldconfig(8): check for no-args command line after options are parsed List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0619dbdfde6d05ac99265ff0b0944468788678dd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638320906; 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=/m1/jCpN7VvyYzi2EoKwytdWuWhm0WyRWQG7LiUYZ9E=; b=BN9u6+jAbTkMaKYaVM2WVwUHVT07ITG/5selX18AqvyVaIRb/i1CQJSXsfs0TuDoPwjZ5X biOM0Gc6yz0f93ooe/QKbevEBtR6dBOmzo9iEzpysDvGtqvpkH0SY8yQLGcmiN8vt9ghOJ pBVPNWMAL2KiD15CPMm2YNol6tKPYapUkLI5WvdFq4GBE7+6pUYwQoCx4WgxA5OqBmD/aH sKz/0uJxuI3L3Y5PJHZ/50h0AQPQrj10kcxhhz/FsU717Yc7vxCdi2txs7QwiV4J6z+oqt 2TSA5OQl4HA61gnLrqlTlYqLY5FDG72fv3xQgVbqP50d5QUc1dFjH0xnAfmilw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638320906; a=rsa-sha256; cv=none; b=NcnnpSf+5A56j+7QzljE1GDp417GeXksZftkvjG5J+kVY1GqnqOIGuJ3J/W7kKQ+z4gS5K yHM2+3NvqpvrKiqrC2EhbBnznoE7wfbOqItCjjbtUQ3Otr6/yBzepyl4HEit6LfuztA3+V swfCm+TD4EDpJXg04XDH5kgekBw4tsG0Ocea/JgGEPBem42fzDFGkcsBBOOAuw407pZYVL sMiAPBTw9qWk8aMPV1Nw3TG5wuboIayyZEnjGHR7mrtyiV5EO61d3Y4hpjtpvJeaNMxlt+ JAnSFRkG1OPNgR0TkrF2RPvhMInsNhnBeoK/ra7hSdUwTS/RxlxS5T1LvBM/tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0619dbdfde6d05ac99265ff0b0944468788678dd commit 0619dbdfde6d05ac99265ff0b0944468788678dd Author: Konstantin Belousov AuthorDate: 2021-11-19 04:07:58 +0000 Commit: Konstantin Belousov CommitDate: 2021-12-01 01:07:19 +0000 ldconfig(8): check for no-args command line after options are parsed (cherry picked from commit 3ede04c78c7c726ed79a39d22c65a58d0ecc5d00) --- sbin/ldconfig/ldconfig.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c index 288c22813121..b039412a648b 100644 --- a/sbin/ldconfig/ldconfig.c +++ b/sbin/ldconfig/ldconfig.c @@ -90,9 +90,7 @@ main(int argc, char **argv) hints_file = _PATH_ELF32_HINTS; else hints_file = _PATH_ELF_HINTS; - if (argc == 1) - rescan = true; - else while((c = getopt(argc, argv, "Rf:imrsv")) != -1) { + while((c = getopt(argc, argv, "Rf:imrsv")) != -1) { switch (c) { case 'R': rescan = true; @@ -121,11 +119,14 @@ main(int argc, char **argv) } } - if (justread) + if (justread) { list_elf_hints(hints_file); - else + } else { + if (argc == optind) + rescan = true; update_elf_hints(hints_file, argc - optind, argv + optind, merge || rescan); + } exit(0); }