From nobody Thu Mar 02 03:01:03 2023 X-Original-To: dev-commits-src-main@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 4PRwpl6C2Jz3vk6g; Thu, 2 Mar 2023 03:01:03 +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 4PRwpl4l94z44PK; Thu, 2 Mar 2023 03:01:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677726063; 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=gBBHS911k8V3ZX7d5oMyWo87uBP/qW9VdWbZuVTQmQs=; b=TaVn9pw53NTvGPK7Dt++WPwbaTLhy1gfP5nN42Lw6MwWtyDHUGsezPwsVnOR0EcM5uUrz5 b1qid944N9VfEg8yZaLHkaA+Ff5XnxW4Pd+ROKOgu74pjGTchCZp7Q4QnVXJDXkey4VTOf XUKRCIGz0VNh548UlDq9lm8chqMwxWrTE1NHxWIh9YghlKIKMDPh1dYRzx/dXVYUvKPW8n vKqmxXZ7fW3fwankjQ1cYfAe59w2TJbXdjmF+VJJJfsRIAIRW2kWtF1kTLFs0JOUknc+Xo VptOeDY23iyyJpD+0IG9OaB8BoqhO2TM5BNodxYX47jIATrle9vaQdWPGS2F9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677726063; 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=gBBHS911k8V3ZX7d5oMyWo87uBP/qW9VdWbZuVTQmQs=; b=j6juo0NsR+piuhpKjst/gx9TyLc4sVoN37INBMGwAXTwel+3S7LxIOHC8q8OAkv8IFSEIe 6ZbZT0XVm5cC+cZ5rc8Aok7QV36KRfiTZ1viOrIjUjheMn0HFjq4as1nKQhY9u+1C3qjsB anPWjTNYbC/hUvqX0rf80hdh1DW+P8vz2KxCcn81nSij5nfxjFlpFCyLxr91Ce3G5REj2x +pzR46YNj1fKYHTTE8QMTdtUTFmmvJXbCLqzBuvDZdUMJHxShd2Umqnngcd7BoZMv8kp5b 44xugbEG0L6G6pfrg1RMacGKGf1V93sRNqGiiV1bveOcd/PXfX/Z0o+ZTDDWBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677726063; a=rsa-sha256; cv=none; b=hHAQmN2EHKhHTvfZ6qLVsBOgBYiOt593eDgEzED06GCUkjRCMk2zPie4574+jbbuM9MlT6 PZGTXUoBwQtsQjBx2ELL0EFkYIhAKeZnP/tEuFx8hDdUWeqi26TjIUteg/UAbXyojC/Z3v grK3G6Sstm8mH0ss3uKKoSjJcDKUaxPYaI7ALYw4QGqDPz5uVVhqrUyQol8pFyDK5Ot8uJ 5ZWhMh96Hteh+WnyaFUfsXAEOF53YN+GPiTUHUEapx0KXrvKyVru9Kg9tOtIX7OR/IB9c7 r+Yhknxd7+8wQ1I91jvyNtnIMlNuwo3tZ1RV7csTn755HzGb43RQNiUsV+sdSQ== 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 4PRwpl3H78zyvK; Thu, 2 Mar 2023 03:01:03 +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 322313ED034060; Thu, 2 Mar 2023 03:01:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 322313Mr034059; Thu, 2 Mar 2023 03:01:03 GMT (envelope-from git) Date: Thu, 2 Mar 2023 03:01:03 GMT Message-Id: <202303020301.322313Mr034059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 259ed21d21f8 - main - daemon: initialize struct sigaction at declaration site List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 259ed21d21f81b656f06447716d41c190576477e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=259ed21d21f81b656f06447716d41c190576477e commit 259ed21d21f81b656f06447716d41c190576477e Author: Ihor Antonov AuthorDate: 2023-03-02 03:00:42 +0000 Commit: Kyle Evans CommitDate: 2023-03-02 03:00:42 +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 --- 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);