From patchwork Thu May 24 05:50:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 919601 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40rz5P3vGYz9s1w for ; Thu, 24 May 2018 15:51:05 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="Qe9ry+Hu"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40rz5P2HBdzF1Cr for ; Thu, 24 May 2018 15:51:05 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="Qe9ry+Hu"; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40rz4m74cWzF1Dt for ; Thu, 24 May 2018 15:50:32 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="Qe9ry+Hu"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 40rz4m304Xz9s16; Thu, 24 May 2018 15:50:32 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1527141032; bh=GAGo1hQIp2ZqlE1AfpazIACAR0fIcaSw1MUUrhCbe9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qe9ry+HuwJ4u+tM/w1VY6GrHxNjy8NU+M1EXHjDxvN4YWhBfoBw2YNSFVTfJgyn4Q DW4MYXv2JLeAaMkuHv+LWosbnzgbj3+/GFjW4/eE2QHKl8S5esYamWYBbEn742NtQK OSlnHaQvy4UjCPooWGFAkt+QxE5Ivh6XYyHh6Y+FhRmt+G6XymVn7ZUDkoG46E+Kap NGCg2GFMRqwBVGTA21fcoynuY+iE9lFc8/BZwgxHfI8GeE9KrCwEIp5LjVFyICGp1c YHiqeUnLv+UYsmXay1kKlienhwzZgxmL+f2dCc/Wvmr8b02P4Im1awl6x3fp922jpr WoeDqotVUSKPw== From: Amitay Isaacs To: "pdbg@lists.ozlabs.org"@lists.ozlabs.org Date: Thu, 24 May 2018 15:50:14 +1000 Message-Id: <20180524055017.8801-9-amitay@ozlabs.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524055017.8801-1-amitay@ozlabs.org> References: <20180524055017.8801-1-amitay@ozlabs.org> Subject: [Pdbg] [PATCH v3 08/11] main: Return false on failure X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" If a boolean function returns true on error, it's just recipe for all sorts of programming errors. Signed-off-by: Amitay Isaacs --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 4e0ed16..7540b9b 100644 --- a/src/main.c +++ b/src/main.c @@ -295,7 +295,7 @@ static bool parse_options(int argc, char *argv[]) if (opt_error) print_usage(argv[0]); - return opt_error; + return !opt_error; } void target_select(struct pdbg_target *target) @@ -594,7 +594,7 @@ int main(int argc, char *argv[]) backend = default_backend(); device_node = default_target(backend); - if (parse_options(argc, argv)) + if (!parse_options(argc, argv)) return 1; if (!backend_is_possible(backend)) {