From nobody Fri Mar 17 21:01:27 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 4Pdc4R5hJTz3yqsN; Fri, 17 Mar 2023 21:01:27 +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 4Pdc4R5Fv3z3q0p; Fri, 17 Mar 2023 21:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086887; 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=Kd/Tipx5ZMcNf3Cb4aLgnzV57NC5MKrN9h3YEj/UOpI=; b=PBhrrj/vSrPRumyy2M/VgD9pt1reJnE1r4tAtgbZksUm+ZBGa5LPkQ/7BZqB3r3nM8A3UM Tb/gqJ1RVyBDOOz/KkNXUkW2mI20bmM7X6laX3Y4P5VEXNnhNKf0X+0Mh2op37nwq0vkIP abrZ70wg8uMsihNAOj1gPBl5Re5ZAR6jZ4Rlsc7eh43xT1v/0gLlqLkGaf0OP0o/Jh0wHb tztD2Rm71/HQ9bfdObWDz2vBcQF+CySH/1xcHCmRJSSd97UClpz5y1Mzdb0Gfybiuc3SMA COenxCI+nB5vVihLChi2SGPe6VJqkkD6vXiFWs95qCtT+gaqEDbtn7kK9QQGRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679086887; 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=Kd/Tipx5ZMcNf3Cb4aLgnzV57NC5MKrN9h3YEj/UOpI=; b=k+VFJZjZhwyFK84taNBZhRU/mFUpphNs4ZjbTE/6iGgwsSEdSBp/+PbFtD2rHf0AuIngOz kaVKJNAzw9q61J/sMX+f1cVgcL79WDCIOxkzM58bqvBFsNiJuG7i1XrOqHT1E/R6gDb3uR 6trUHSjPF9STlef7ARVA+3HN/dV02T0JqbYDRDNaHTPCmnZ7H68dBt06uqRiTbEqCTtaKz Pqe/CPuXq3sH6PHcfzlLQtQBEJ9BgPoa0XPHpfBUVIgPAJO8RjQAKhD0M7vyMSkWgXtgJ/ AY1iObLWx1R4EW97DCuBGOt//giuuqHOVj7rBEsQWWx3gv8Xl8PfmZ3EQLsrWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679086887; a=rsa-sha256; cv=none; b=eUhk++yskTac2qa12vsJ5O+1DPVaKARyU1Olz5ovxn0sSrjjj1jVq26shovZ+6t/dOPZ1Y V6qe1daFxGL02M8bc9LF30fqL1SFUi356Z+unrKlKyR/Ft4Ji1NdWR4krbu3dM2mqqQ9M1 FZ+WzvG2lpG2z/z9YSyk9SYYZL3ZUHrmaNK7cjSkbodIDxh015k/a4r24aPFXgf24+J046 drUG+6AZlnVRt5HcguYkCO071hY82qNKsgr4+/dmo9ULzw3Uapjdwf64FkC2vQfhtOSS9w fsoNQtVCtTrTySlDzPpWEI14aTkGR2vnhPVNzOPCDU7bszlbVv5U8A8V32RYfw== 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 4Pdc4R43k7zgbR; Fri, 17 Mar 2023 21:01:27 +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 32HL1RX7015036; Fri, 17 Mar 2023 21:01:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32HL1RTG015035; Fri, 17 Mar 2023 21:01:27 GMT (envelope-from git) Date: Fri, 17 Mar 2023 21:01:27 GMT Message-Id: <202303172101.32HL1RTG015035@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: 52f302f1361f - stable/13 - daemon: initialize struct sigaction at declaration site 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: 52f302f1361feb0d1888219b897465693bf64177 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=52f302f1361feb0d1888219b897465693bf64177 commit 52f302f1361feb0d1888219b897465693bf64177 Author: Ihor Antonov AuthorDate: 2023-03-02 03:00:42 +0000 Commit: Kyle Evans CommitDate: 2023-03-17 21:01:01 +0000 daemon: initialize struct sigaction at declaration site This improves readability by uncluttering the code Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/669 (cherry picked from commit 259ed21d21f81b656f06447716d41c190576477e) --- usr.sbin/daemon/daemon.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr.sbin/daemon/daemon.c b/usr.sbin/daemon/daemon.c index 4fe749d9e5fa..0925d16a27a0 100644 --- a/usr.sbin/daemon/daemon.c +++ b/usr.sbin/daemon/daemon.c @@ -287,20 +287,19 @@ main(int argc, char *argv[]) * and syslog. */ if (pidfile || ppidfile || restart || outfd != -1 || dosyslog) { - struct sigaction act_term, act_chld, act_hup; + struct sigaction act_term = { 0 }; + struct sigaction act_chld = { 0 }; + struct sigaction act_hup = { 0 }; /* Avoid PID racing with SIGCHLD and SIGTERM. */ - memset(&act_term, 0, sizeof(act_term)); act_term.sa_handler = handle_term; sigemptyset(&act_term.sa_mask); sigaddset(&act_term.sa_mask, SIGCHLD); - memset(&act_chld, 0, sizeof(act_chld)); act_chld.sa_handler = handle_chld; sigemptyset(&act_chld.sa_mask); sigaddset(&act_chld.sa_mask, SIGTERM); - memset(&act_hup, 0, sizeof(act_hup)); act_hup.sa_handler = handle_hup; sigemptyset(&act_hup.sa_mask);