From patchwork Thu Oct 17 22:50:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 35116 Received: (qmail 108593 invoked by alias); 17 Oct 2019 22:50:54 -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 107907 invoked by uid 89); 17 Oct 2019 22:50:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=Apr, apr, device X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Oct 2019 22:50:47 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AD7E7C04959E for ; Thu, 17 Oct 2019 22:50:46 +0000 (UTC) Received: from localhost.localdomain (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F13F1001B33 for ; Thu, 17 Oct 2019 22:50:46 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v2 21/24] Revert 'Remove unused struct serial::name field' Date: Thu, 17 Oct 2019 23:50:23 +0100 Message-Id: <20191017225026.30496-22-palves@redhat.com> In-Reply-To: <20191017225026.30496-1-palves@redhat.com> References: <20191017225026.30496-1-palves@redhat.com> This commit reverts: commit 5f5219fc34f7557296272230123a3837960a6f09 Author: Pedro Alves AuthorDate: Tue Apr 12 16:49:30 2016 +0100 Remove unused struct serial::name field The following patches will add uses for the field. gdb/ChangeLog: yyyy-mm-dd Pedro Alves Revert: 2016-04-12 Pedro Alves * serial.c (serial_open, serial_fdopen_ops, do_serial_close): Remove references to name. * serial.h (struct serial) : Delete. --- gdb/serial.c | 4 ++++ gdb/serial.h | 1 + 2 files changed, 5 insertions(+) diff --git a/gdb/serial.c b/gdb/serial.c index a881bbc97c..0ed3d37406 100644 --- a/gdb/serial.c +++ b/gdb/serial.c @@ -247,6 +247,7 @@ serial_open_ops_1 (const struct serial_ops *ops, const char *open_name) return NULL; } + scb->name = open_name != NULL ? xstrdup (open_name) : NULL; scb->next = scb_base; scb_base = scb; @@ -291,6 +292,7 @@ serial_fdopen_ops (const int fd, const struct serial_ops *ops) scb = new_serial (ops); + scb->name = NULL; scb->next = scb_base; scb_base = scb; @@ -330,6 +332,8 @@ do_serial_close (struct serial *scb, int really_close) if (really_close) scb->ops->close (scb); + xfree (scb->name); + /* For serial_is_open. */ scb->bufp = NULL; diff --git a/gdb/serial.h b/gdb/serial.h index b75b3666e7..d58ab660e9 100644 --- a/gdb/serial.h +++ b/gdb/serial.h @@ -240,6 +240,7 @@ struct serial buffer. -ve for sticky errors. */ unsigned char *bufp; /* Current byte */ unsigned char buf[BUFSIZ]; /* Da buffer itself */ + char *name; /* The name of the device or host */ struct serial *next; /* Pointer to the next `struct serial *' */ int debug_p; /* Trace this serial devices operation. */ int async_state; /* Async internal state. */