From nobody Fri Mar 17 21:01:26 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 4Pdc4Q4Pd8z3yqdt; Fri, 17 Mar 2023 21:01:26 +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 4Pdc4Q3lqMz3pjs; Fri, 17 Mar 2023 21:01:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086886; 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=Ae/Hht4QOjnSyORFXAMe0gLrgNG9J0x64makHwXenvg=; b=O8cVuC/sKbZeCiQnXK8ldxjfnshHaHZDOZTThBmasE71HFyTmQ+/79+cFjkYZFI31zSy4J vdax7Ml0tW3MmDA4tTwGuCXbma5ZouPJWCyeRhLgScDIVD6XC0xAwsJovw7nqxRmfOfxUz OuMPtgwPvjwyySZoEXBSU+DCkS8Kbkk8Qpd/Lgc4AOu8J5uKTGwq16r0ieTfhyWtfC9Tnz 7TSCZDgkhH/Fz1SoDiUIeHIzWiXxNFHHGV9LFi+eEreXYirkCpS3awQtWPpuSkqwc0vCPG Ttd4zI3Etoc5rC1pIylmr2Sg7rHouoAWKj8JYweJS1vJyzMnmmVobicKWB3snw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086886; 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=Ae/Hht4QOjnSyORFXAMe0gLrgNG9J0x64makHwXenvg=; b=dAIygeiGeaTcZI6tnEETh+w/Heqy9db6OgcVWz03hh0QJKtOKCnNTA0oPf42wDOBvJWW0c iNzuA/0xIgFWGAkFFHsK6KIG6e3mZpdiJn8wE9HM1jDTRbziAseRcEG1DO80ef6v8zj1h2 oa/IAgo01Sv3Z8xS9SOLsw2huISOCnHJdFLolyDxWksBAtJZDrEzaOUGG1c8g57fOWkngD Yh2X/IU8uSDc7enKkxZxHRymCUHjanto/kOsAi8tXLUb2lWKRzQCVH+pitaVZbcnKp+6sH d9qjQRkvifk52/lQmrsr68ZGjul7wBa5i0qPEwmI6QYuu73aOD6jaqIjlR3WZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086886; a=rsa-sha256; cv=none; b=p24PDrAXoZ1HkHE6KBrLUp3T3N9r1K8Gv24MoG9KL/CUHb6UghpYpS8Xj9gvhcidrbszbn 9pHixpJrEikmAZSnXooVuw4pvHNqANCGgf9w/WF4xCj/9m9Men2xdOy3H06dY2zisRTrn5 iNQ7lE/8W8irTD2JMNwbiqrawrvwDsNvjzs3XSgdB74YuwthfISrVNsDI6uCF2n7T+dMbR pMz40GQjPDu/ok/ZxWKum61pbJD8WTQJea7yI7OR012/OQt1EN1PHCKp30Fkln3MPxbPLi 4zWAaaG8F796GBic5Qf1fU24lm5PzC7xGTTgevOxRXGDlFBOgJiy6IUuoohZeA== 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 4Pdc4Q2sxSzgjt; Fri, 17 Mar 2023 21:01: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 32HL1QOW015017; Fri, 17 Mar 2023 21:01:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1Qol015016; Fri, 17 Mar 2023 21:01:26 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:26 GMT Message-Id: <202303172101.32HL1Qol015016@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 93871c6cff22 - stable/13 - daemon: fix double init of pid variable 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: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 93871c6cff22231c94f14455f7896334d0547627 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=93871c6cff22231c94f14455f7896334d0547627 commit 93871c6cff22231c94f14455f7896334d0547627 Author: Ihor Antonov AuthorDate: 2023-03-02 03:00:42 +0000 Commit: Kyle Evans CommitDate: 2023-03-17 21:01:01 +0000 daemon: fix double init of pid variable Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/669 (cherry picked from commit 91b921c7d4684599d1d983f77dcc3df90900adc0) --- usr.sbin/daemon/daemon.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 9477b2a415e8..4fe749d9e5fa 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -81,7 +81,7 @@ static void daemon_sleep(time_t, long); static volatile sig_atomic_t terminate = 0; static volatile sig_atomic_t child_gone = 0; -static volatile sig_atomic_t pid = 0; +static volatile sig_atomic_t pid = -1; static volatile sig_atomic_t do_log_reopen = 0; static const char shortopts[] = "+cfHSp:P:ru:o:s:l:t:m:R:T:h"; @@ -286,7 +286,6 @@ main(int argc, char *argv[]) * readable pipe with the child for writing to a log file * and syslog. */ - pid = -1; if (pidfile || ppidfile || restart || outfd != -1 || dosyslog) { struct sigaction act_term, act_chld, act_hup;