From nobody Thu Sep 28 15:52:36 2023 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 4RxJ042077z4tyD5; Thu, 28 Sep 2023 15:52:36 +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 4RxJ041Skdz4Km3; Thu, 28 Sep 2023 15:52:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695916356; 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=UpaNHhMesP1diCQH6KFx+T5rklksPu7I3a8phQtpa7o=; b=DsLXqFxZ8QyK5mpa1uOVKoNQx31AgVGVBZoEgNqT5mPUDtmSu+D57KtPla75FympJnx6av ROl1VA+/FvuvjN7BrfmTRPGz7kKoWW+g09QteqiulKrqHQZ7903o7yYe7ZcfH0HV+vyV1W MMokiY2t8sN5x5m0Uoeit/6vTR5tV0sjCvlj1h4zZd3MI//Dq6DWf4+Tj8nTPCHX6S8N/H VXrk14IZE6IT5rjKqqAeG35nRBzuBIncksTjXb+/3QErRD6PFeyOki6AFS2H5pDi0DJzkV PjGfr1H4iuIk7C1fiR2egbFmYO7Oq81nbFHFHWcKUUdB4ByqP2RKneVLiMeV6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695916356; a=rsa-sha256; cv=none; b=eF3Uz16Nyk9kpoU5vowh9mWgXYFUoxm1vXUHIvxt12J71RFUf4XuJOJMOItF7zaXbJWi5Z ViLlZ849+Itxhc0dYfgYL1XIUyWrtYqUNHRV7X5OOft3uljMduJsi4nWZyqLaDd/t2T3xK /3CuaLhiPfXzzIJaKjG+K7kSgHBUsWujsGdUyqChNO7R3jSCA6ry86EShvAtwc0Oi9PRtX LyCP925f84mOZpmz2EklDvGVSKsBprs43/TWS6QYV2TqNCSxrAAmiV8CUjtCSbueV6F1Zk o9TP2gp8knomdPIOlSIsY6meyrkEFyi/TDl97+6cbwAtVUqSoRjFv6Dz8Q5ODw== 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=1695916356; 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=UpaNHhMesP1diCQH6KFx+T5rklksPu7I3a8phQtpa7o=; b=NKxqeXwKOEBmzOXsTAnPVp6ugDFuO3bGdmJ8E/wfGKZxmWjbE1Mvl9D4snrLs9001lNjCA oLh2eTAu4PFGr3X6cKUXVN0xSyAbWK7sp0pRyqhIn7OgMdPcq0lE2NX1OgHLa+Mo1cQVgt brTSXzPXSyJ1toP5I2MAjZPwXjRwrEo5u/hP6RJmmq6Q1vzs+52D/7quGXmYN7ggHYG/5P RqTPJvyhHAOUEkFTzcXMppEtB94SOtgCFxj0xzSEzNpkkjM4AiUhziq+qY1ntcEUcP2Fdv OeRt3iVwUvHBHwgg4aW23YF3WnKtFSrcKivpOII+9DAOQyN1/EMrrJSIX31UMQ== 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 4RxJ040ZwxzDL7; Thu, 28 Sep 2023 15:52:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38SFqaRG022075; Thu, 28 Sep 2023 15:52:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38SFqaxk022072; Thu, 28 Sep 2023 15:52:36 GMT (envelope-from git) Date: Thu, 28 Sep 2023 15:52:36 GMT Message-Id: <202309281552.38SFqaxk022072@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: bbde787c6668 - main - syslogd: Merge loops 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bbde787c6668803e2c4e999ef699d545b26160a6 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bbde787c6668803e2c4e999ef699d545b26160a6 commit bbde787c6668803e2c4e999ef699d545b26160a6 Author: Jake Freeland AuthorDate: 2023-09-01 02:50:26 +0000 Commit: Mark Johnston CommitDate: 2023-09-28 15:51:53 +0000 syslogd: Merge loops Merge the two loops that traverse the global filed queue. Both loops' actions are not dependent on the other, so combining them is safe. Reviewed by: markj MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41370 --- usr.sbin/syslogd/syslogd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index c20928d48495..a37f3a9482bf 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -2575,7 +2575,10 @@ init(bool reload) * Close all open log files. */ Initialized = false; - STAILQ_FOREACH(f, &fhead, next) { + while (!STAILQ_EMPTY(&fhead)) { + f = STAILQ_FIRST(&fhead); + STAILQ_REMOVE_HEAD(&fhead, next); + /* flush any pending output */ if (f->f_prevcount) fprintlog_successive(f, 0); @@ -2593,10 +2596,7 @@ init(bool reload) default: break; } - } - while(!STAILQ_EMPTY(&fhead)) { - f = STAILQ_FIRST(&fhead); - STAILQ_REMOVE_HEAD(&fhead, next); + free(f->f_program); free(f->f_host); if (f->f_prop_filter) {