From nobody Thu Feb 15 21:32:54 2024 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 4TbSw65C7rz5BHqQ; Thu, 15 Feb 2024 21:32:54 +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 4TbSw64WRKz4VF8; Thu, 15 Feb 2024 21:32:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708032774; 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=0u3CPzJiDgIHXUmQayNbwdTx0BEgrz4LzrXLtjbZMAY=; b=GtwZ8FyNaOzDLj62Z6wA/fxWQ/6gw0OqyeKTbSjQjHSW0y3CaGm0AY0xzOPYYX1Vk8AJ58 8mrquHbut5fA0NZECY+v8Kk5Wn6gAoJfmPUJMexQAOz1t27FiXwvRnR8g4h+NegzoWyyur vPzmvlx8lluJx0Li6WVcqX0W79IlfNTC9JcD7mIvYsmNae1fz8UZA5FtysnTHGVzpvRrzK CfD47OqM0h5eQoBCr5IVvKa+wIj/pew++mbcbSmHffByqVCLD0YPNGAVUZGUaC6PK7bfqj RiuN6U2MBy1URXRDveutOUAMMHziIPYXTiRehny3GV/f3rKlK1IIbCM+0foTbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708032774; 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=0u3CPzJiDgIHXUmQayNbwdTx0BEgrz4LzrXLtjbZMAY=; b=YWO9dOfFeNEuUbzSz+1Abj+0d4xiN1pU7o0IHC0glEKLJdc4y1p9l+StTv/N0J0o1Gzsha OBDHnbX/4QA2wq9Yhm/2PdTHvZsasm+dBk1OOuery8K56gfVzC2mJ1fJjwQlklF89RjcaE II2tSpcb32TXHiaCcknKmfWj3ffLDIh+S+pkbNvD7PYFWveTMR9msoA+/h/BGuxjasxZ8k PJLF/MnGvwoMYWdVDEH+1R7nebHzC0QHt5x9rDrsYv0lC4BowSuZQO0gT988rCY9jrkA9S GpmN6r5cbBuYDUeYIIpicdRG2t3MMzWtr9qyHf/N1l/h/IkjS+brPwup7K5V8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708032774; a=rsa-sha256; cv=none; b=PCW15/fKE3czFvLkLHI9kSJ/7r0N66edj2cgJrjPpn12qDkP8FQaxnqKVoY36tCQJQ3G7P pjoqEjFNqEuFsEE/25mhuHUOwTddIAt+MMjcBwM91MHG36Et1Fdbqf2qIWiBr+rAHztsQx CBscrxbUHOP77NRhoHuWQyNvGRupDsu1E5wi+rdWa3XTO1cw835HAFsKsBNIzFkcflYeyg npCAjwhDQCX+Myg9UvbSX+AcCKzYLJkllD546bEyLWRSDc2jbZub4BvUoVi7rZaR6tV7sR W6phBhO1ueWcivtx8MLs45Ok8pfWglM7rETsUVm67Hc1iIjAVJfGVWiYIiqhNQ== 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 4TbSw63ZqCzxyd; Thu, 15 Feb 2024 21:32:54 +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 41FLWsK5070758; Thu, 15 Feb 2024 21:32:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41FLWsjE070755; Thu, 15 Feb 2024 21:32:54 GMT (envelope-from git) Date: Thu, 15 Feb 2024 21:32:54 GMT Message-Id: <202402152132.41FLWsjE070755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: e32de9626f1a - main - reboot: initialize howto 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e32de9626f1aaf6a564c93a139b43a1bad70fa2e Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e32de9626f1aaf6a564c93a139b43a1bad70fa2e commit e32de9626f1aaf6a564c93a139b43a1bad70fa2e Author: Warner Losh AuthorDate: 2024-02-15 21:28:54 +0000 Commit: Warner Losh CommitDate: 2024-02-15 21:32:04 +0000 reboot: initialize howto Make static analyzers happy by initialzing howto to 0. Coverity is cranky that it could be used unused. But it's analysis is incomplete because the args to getopt when it wasn't initialized preclude it from being used. --- sbin/reboot/reboot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c index a31c31892745..e9d6487da6a5 100644 --- a/sbin/reboot/reboot.c +++ b/sbin/reboot/reboot.c @@ -175,7 +175,7 @@ main(int argc, char *argv[]) { struct utmpx utx; const struct passwd *pw; - int ch, howto, i, sverrno; + int ch, howto = 0, i, sverrno; bool Dflag, fflag, lflag, Nflag, nflag, qflag; uint64_t pageins; const char *user, *kernel = NULL, *getopts = GETOPT_REBOOT; @@ -188,6 +188,7 @@ main(int argc, char *argv[]) donextboot = true; getopts = GETOPT_NEXTBOOT; /* Note: reboot's extra opts return '?' */ } else { + /* reboot */ howto = 0; } Dflag = fflag = lflag = Nflag = nflag = qflag = false;