From patchwork Thu Nov 15 07:19:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 998137 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wXnp020Qz9sCQ for ; Thu, 15 Nov 2018 18:20:30 +1100 (AEDT) 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="L/0uZdqK"; 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 42wXnn5L0vzF3cH for ; Thu, 15 Nov 2018 18:20:29 +1100 (AEDT) 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="L/0uZdqK"; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42wXms3RQxzF3bw for ; Thu, 15 Nov 2018 18:19:41 +1100 (AEDT) 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="L/0uZdqK"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 42wXms0c4Vz9sCm; Thu, 15 Nov 2018 18:19:41 +1100 (AEDT) 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=1542266381; bh=x6R0WtGlUY8X2ei57ZvnNu8UOUL2JZMSIN2db2ABEc8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L/0uZdqKwQu7aeFXI5KdSydzAaLoDXXyeSSl/wJtddGOaJnutREvgSTthC+k09jSv trjH+jzIQ0x9RylJovKOxmduVqTigFcfpiMA841Fg4a5Pj02wX9PrwQNwy66a4uYSJ M4yxh6xdK+9by/+1mpHuB1VPAQQVqnMW5YfMnGepjo9lHh0yjePFyoP17JRviO2wyP ry0pV7o0O5xFR/MxYHeE4DxzWdsgtWqjY5txwKbxi6+Gn28wuju6vOxoOf2o80+4pW uFVcETvrzADughBAqZJONlr3ySIAFH26ZNItRkgRdmdpp4CDJKUrggzgJz9Tb/JIX9 40hO6CPmj4lWA== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 15 Nov 2018 18:19:24 +1100 Message-Id: <20181115071929.206974-12-amitay@ozlabs.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181115071929.206974-1-amitay@ozlabs.org> References: <20181115071929.206974-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH v3 11/16] main: Do not use argv[0] for progname X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 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 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" When pdbg is built without "--disable-shared" option, libtool creates pdbg as a wrapper around lt-pdbg binary. This causes the tests to fail which try to match the output containing argv[0]. Signed-off-by: Amitay Isaacs Reviewed-by: Alistair Popple --- src/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 3b20bf0..51e39d9 100644 --- a/src/main.c +++ b/src/main.c @@ -143,11 +143,11 @@ static struct action actions[] = { { "gdbserver", "", "Start a gdb server" }, }; -static void print_usage(char *pname) +static void print_usage(void) { int i; - printf("Usage: %s [options] command ...\n\n", pname); + printf("Usage: pdbg [options] command ...\n\n"); printf(" Options:\n"); printf("\t-p, --processor=<0-%d>||\n", MAX_PROCESSORS-1); printf("\t-c, --chip=<0-%d>||\n", MAX_CHIPS-1); @@ -440,7 +440,7 @@ static bool parse_options(int argc, char *argv[]) case '?': case 'h': opt_error = true; - print_usage(basename(argv[0])); + print_usage(); break; } } while (c != EOF && !opt_error); @@ -743,7 +743,7 @@ int main(int argc, char *argv[]) return 1; if (optind >= argc) { - print_usage(basename(argv[0])); + print_usage(); return 1; }