From patchwork Tue Jun 12 00:30:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 10459005 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 67909601AE for ; Tue, 12 Jun 2018 00:30:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55BEA28718 for ; Tue, 12 Jun 2018 00:30:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D2D328715; Tue, 12 Jun 2018 00:30:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A24D2873D for ; Tue, 12 Jun 2018 00:30:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934006AbeFLAao (ORCPT ); Mon, 11 Jun 2018 20:30:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:53950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934597AbeFLAan (ORCPT ); Mon, 11 Jun 2018 20:30:43 -0400 Received: from garbanzo.do-not-panic.com (c-73-15-241-2.hsd1.ca.comcast.net [73.15.241.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 72C28208B4; Tue, 12 Jun 2018 00:30:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528763442; bh=wYx0CWKKzd/w+xC/XlkP1I/akC2CX4J0UNnLwrMI1RU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mOWncLSWLCqTn0S3FMno1rYO8/n2eeEBxPdLxo+QOymqv22VaW7io0+QaKGfhCKKy lOmIx+K7mNSfhkcMydna6GY9mpcP623cGRoaZvcksIfHp24YMvorkQAJInl4UKhqUq i63BTK+zIxVAYeWfCkw5WytbpassHNlIsZTcoGYQ= From: "Luis R. Rodriguez" To: sandeen@sandeen.net, linux-xfs@vger.kernel.org Cc: darrick.wong@oracle.com, jack@suse.com, jeffm@suse.com, okurz@suse.com, lpechacek@suse.com, jtulak@redhat.com, "Luis R. Rodriguez" Subject: [PATCH v6 4/5] xfsprogs: reset opterr on platform_getoptreset() Date: Mon, 11 Jun 2018 17:30:38 -0700 Message-Id: <20180612003039.17154-5-mcgrof@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612003039.17154-1-mcgrof@kernel.org> References: <20180612003039.17154-1-mcgrof@kernel.org> Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Setting opterr = 0 is useful if you want to only parse a subset of paremeters first. Later you will have to set opterr = 1 again, but we already have a platform_getoptreset() and its expected to be used in these contexts so just sprinkle it there. Signed-off-by: Luis R. Rodriguez --- include/darwin.h | 1 + include/gnukfreebsd.h | 1 + include/linux.h | 1 + 3 files changed, 3 insertions(+) diff --git a/include/darwin.h b/include/darwin.h index 2632e1d6f08c..4c23a1a3f739 100644 --- a/include/darwin.h +++ b/include/darwin.h @@ -79,6 +79,7 @@ static __inline__ void platform_getoptreset(void) { extern int optreset; optreset = 0; + opterr = 1; } static __inline__ int platform_uuid_compare(uuid_t *uu1, uuid_t *uu2) diff --git a/include/gnukfreebsd.h b/include/gnukfreebsd.h index 1db3f4f010e3..26e5d9e08cd5 100644 --- a/include/gnukfreebsd.h +++ b/include/gnukfreebsd.h @@ -83,6 +83,7 @@ static __inline__ void platform_getoptreset(void) { extern int optind; optind = 0; + opterr = 1; } static __inline__ int platform_uuid_compare(uuid_t *uu1, uuid_t *uu2) diff --git a/include/linux.h b/include/linux.h index 1998941a6df5..a9273239c419 100644 --- a/include/linux.h +++ b/include/linux.h @@ -88,6 +88,7 @@ static __inline__ void platform_getoptreset(void) { extern int optind; optind = 0; + opterr = 1; } static __inline__ int platform_uuid_compare(uuid_t *uu1, uuid_t *uu2)