From patchwork Tue Jul 28 18:17:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 7901 Received: (qmail 106347 invoked by alias); 28 Jul 2015 18:18:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 106320 invoked by uid 89); 28 Jul 2015 18:18:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-qg0-f47.google.com Received: from mail-qg0-f47.google.com (HELO mail-qg0-f47.google.com) (209.85.192.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 28 Jul 2015 18:18:05 +0000 Received: by qgeu79 with SMTP id u79so80344710qge.1 for ; Tue, 28 Jul 2015 11:18:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hh0AFMTmUm6bsuBlGYXTUAbuBCRLGJB+LuEgyReOEFQ=; b=fgC6nfdHqBQtXLM38LR0hB9dFZhEaZUFV3k54EVA+Twfkp9x+Dkqd5r8Nllos7SgVG yLjEXXFtB84OktJ+/FVkKYl7SfLkbWjKRl4oGV8Dg/5x+XNaNYcDNb2W8AbAitk2iCT8 EpnRnjuhJ//DP/VEQ4Dhuoe6+hZ9uzaqyfajeIe9tiqG+Nx87Lx4nKRsFcOjmNvE2Hwy 9ARAe72RrzfJe8wJ2bB07LVhNzjgaSlexTJk76GGY/qJG5ZDrEYwQg8hfrCOmSXW/Egc Ww1ibFxMyoyn/Kq/6BhSUceHgivyFA/jMHPZf/AHl12sIbcDqolL7Nb+HejQA7S7YKsL WnGw== X-Gm-Message-State: ALoCoQljaA6llmO891qH51BJ6TsrFgBIchTKPkW4kVnWho99GsXk2DUXa5/T+LLYFqDwvbrTswpy X-Received: by 10.140.94.132 with SMTP id g4mr50744593qge.63.1438107482855; Tue, 28 Jul 2015 11:18:02 -0700 (PDT) Received: from localhost.localdomain (ool-4353acd8.dyn.optonline.net. [67.83.172.216]) by smtp.gmail.com with ESMTPSA id b132sm11673022qka.19.2015.07.28.11.18.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Jul 2015 11:18:02 -0700 (PDT) From: Patrick Palka To: gdb-patches@sourceware.org Cc: Patrick Palka Subject: [PATCH] Initialize terminal_state to terminal_is_ours Date: Tue, 28 Jul 2015 14:17:53 -0400 Message-Id: <1438107473-10965-1-git-send-email-patrick@parcs.ath.cx> Right now this variable is initialized to 0 i.e. terminal_is_inferior and does not get set to terminal_is_ours until target_terminal_init() is called. This function only gets called when an inferiro is first created. In the meantime however, terminal_state would wrongly remain terminal_is_inferior. Tested on x86_64 Debian Stretch -- native, gdbserver and extended-gdbserver. gdb/ChangeLog: * target.c (terminal_state): Initialize to terminal_is_ours. --- gdb/target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/target.c b/gdb/target.c index 4e2d005..a39201d 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -444,7 +444,7 @@ enum terminal_state terminal_is_ours = 2 }; -static enum terminal_state terminal_state; +static enum terminal_state terminal_state = terminal_is_ours; /* See target.h. */