From nobody Tue Jun 23 16:28:33 2026 X-Original-To: dev-commits-src-all@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 4gl9VV2q4Kz6hhXn for ; Tue, 23 Jun 2026 16:28:34 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gl9VT5vWcz3Mxn for ; Tue, 23 Jun 2026 16:28:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782232113; 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=5ov/+yjEjEBGN/VdO3+ttpL9rZR0XjM7DSu1rpaK0t8=; b=i2E9aPmNb6TPinLZoKhOXjF4MC84k3dWLL+A2Gn0whvK+RWmn3s7V/iS+iaVl9x+doUmEc cR61kT2MtuMNyskX/IRxq38L3xFJ6TyhDCEmpjsAOF5XsDP1jIEuZP2pgrZffBntFIjQxr QKnCEPGwWqU8poWyfEIsKTqzGdsRKf68fMyG3y7TETpggo9Matrval+Twp15oYCgLnr4fC X+oxlb2xpunUORMvqw2DChJ4MeMOzk6A01ABAtJhPSimL+Zn2xGT+qZ3CrHlk0X0+A4pU7 yk+QlEq0Py+6yONKdUxktYuuZT+frSdvaitikYLOnkYx8lRd6c4GqI1l0Ona0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782232113; a=rsa-sha256; cv=none; b=BGhEP+NXxHMy9BvnlCkQ6gM5LsoQ2B4GulcSui1JDd8c1qn94yuIYyMgFhKrkBXBYXU9Nb fmQpx9UDSUNx84aMbwpHnYpRcGfjg1yvqrNthyU2cKHPXkuaUxwBMEuwj7gKPQE+Bei7eo Pc6+XjCIQ1vcSwfzxCmt7EU5f4ZlhIi6ypoKNzrvYfMPQaTwsOfajNEoRKqRR8XcucRGpD rgfMNW/Ym4pqm9DvdLTaU38yfKs4AWs4N/BD16Fme5iFz9GDvNpIgSxdWnHA4AIw9q2W3C STo+a4xUJ2jZ3aeiefohm4d4sDcQCasaRnAJMa8mMRxfE5+cT/rLezrPFo2f0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782232113; 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=5ov/+yjEjEBGN/VdO3+ttpL9rZR0XjM7DSu1rpaK0t8=; b=dnNnpmmY15OQpclqJ1fAdBHRj7Xjq5vZpU8BBhICz6QLxFW/hZ1G+r6ybBk98a4LWEMGnO sX6alsJfNEejfvJF6mxRh45D+qBhNDse5WwX6olAliwcAFWoDGyXmfw/LiLBbWZVPJs/NM bCqQdnrxJv9VbEmYz3eG3Fl0X3MjvoHDdUaA6EDFG5YgIeWUpwsq4obYhDfmWGCrPjbuQj eyYB82QU0EJaEmztws5M55Xy2d25JhPwl8BFGPFCE2tOg9gB8hlWb130Hcdl5A466+RW95 AHQIlOuXIJBcz7jif8fDmRYn7q4ILm7MlXF044tyh2NWPB8oBKR83jKlOiSoYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gl9VT3PQLzj5N for ; Tue, 23 Jun 2026 16:28:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26fa4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 23 Jun 2026 16:28:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7e04dc80119f - stable/15 - ctld: Simplify pidfile rename handling in conf::apply List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 7e04dc80119f8b7d9285291aab0fb9e56b0a857e Auto-Submitted: auto-generated Date: Tue, 23 Jun 2026 16:28:33 +0000 Message-Id: <6a3ab431.26fa4.23fff5b9@gitrepo.freebsd.org> The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7e04dc80119f8b7d9285291aab0fb9e56b0a857e commit 7e04dc80119f8b7d9285291aab0fb9e56b0a857e Author: John Baldwin AuthorDate: 2026-05-18 19:49:57 +0000 Commit: John Baldwin CommitDate: 2026-06-23 16:17:31 +0000 ctld: Simplify pidfile rename handling in conf::apply Explicitly copy the pidfile path from the initial configuration file to the kernel-derived configuration to avoid having to check if the old path is empty as a special case in conf::apply(). Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D56533 (cherry picked from commit 9306d0449ba6fffadf08d5ab61aea596369e03f4) --- usr.sbin/ctld/ctld.cc | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/usr.sbin/ctld/ctld.cc b/usr.sbin/ctld/ctld.cc index 24b02a936670..9bdf15976911 100644 --- a/usr.sbin/ctld/ctld.cc +++ b/usr.sbin/ctld/ctld.cc @@ -1973,22 +1973,14 @@ conf::apply(struct conf *oldconf) log_init(conf_debug); } - /* - * Rename the pidfile if the pathname changes. On startup, - * oldconf created via conf_new_from_kernel will not contain a - * valid pidfile_path. - */ - if (!oldconf->conf_pidfile_path.empty()) { - if (oldconf->conf_pidfile_path != conf_pidfile_path) { - /* pidfile has changed. rename it */ - log_debugx("moving pidfile to %s", + /* Rename the pidfile if the pathname changes. */ + if (oldconf->conf_pidfile_path != conf_pidfile_path) { + log_debugx("moving pidfile to %s", conf_pidfile_path.c_str()); + if (rename(oldconf->conf_pidfile_path.c_str(), + conf_pidfile_path.c_str()) != 0) { + log_err(1, "renaming pidfile %s -> %s", + oldconf->conf_pidfile_path.c_str(), conf_pidfile_path.c_str()); - if (rename(oldconf->conf_pidfile_path.c_str(), - conf_pidfile_path.c_str()) != 0) { - log_err(1, "renaming pidfile %s -> %s", - oldconf->conf_pidfile_path.c_str(), - conf_pidfile_path.c_str()); - } } } @@ -2748,6 +2740,9 @@ main(int argc, char **argv) newconf->set_debug(debug); } + /* Reuse the pidfile path from the configuration file. */ + oldconf->set_pidfile_path(newconf->pidfile_path()); + if (!newconf->add_pports(kports)) log_errx(1, "Error associating physical ports; exiting");