From owner-svn-src-all@freebsd.org Thu Feb 20 21:30:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 72551246B92; Thu, 20 Feb 2020 21:30:00 +0000 (UTC) (envelope-from bcran@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Nnmm1mw9z4Xh4; Thu, 20 Feb 2020 21:30:00 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D1481A2; Thu, 20 Feb 2020 21:30:00 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01KLTx0w009350; Thu, 20 Feb 2020 21:29:59 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01KLTxKF009349; Thu, 20 Feb 2020 21:29:59 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <202002202129.01KLTxKF009349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Thu, 20 Feb 2020 21:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358183 - head/usr.bin/dtc X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.bin/dtc X-SVN-Commit-Revision: 358183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2020 21:30:00 -0000 Author: bcran Date: Thu Feb 20 21:29:59 2020 New Revision: 358183 URL: https://svnweb.freebsd.org/changeset/base/358183 Log: dtc: remove unknown option printf, since getopt will print it Since we don't set opterr to 0, getopt prints a message when it encounters an unknown/invalid option. We therefore don't need to print our own message in the default handler. Reviewed by: kevans, theraven Differential Revision: https://reviews.freebsd.org/D23662 Modified: head/usr.bin/dtc/dtc.cc Modified: head/usr.bin/dtc/dtc.cc ============================================================================== --- head/usr.bin/dtc/dtc.cc Thu Feb 20 21:25:12 2020 (r358182) +++ head/usr.bin/dtc/dtc.cc Thu Feb 20 21:29:59 2020 (r358183) @@ -304,7 +304,10 @@ main(int argc, char **argv) } break; default: - fprintf(stderr, "Unknown option %c\n", ch); + /* + * Since opterr is non-zero, getopt will have + * already printed an error message. + */ return EXIT_FAILURE; } }