From patchwork Thu May 17 08:28:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julio Guerra X-Patchwork-Id: 27313 Received: (qmail 127957 invoked by alias); 17 May 2018 08:28:07 -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 127943 invoked by uid 89); 17 May 2018 08:28:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: a6-226.smtp-out.eu-west-1.amazonses.com Received: from a6-226.smtp-out.eu-west-1.amazonses.com (HELO a6-226.smtp-out.eu-west-1.amazonses.com) (54.240.6.226) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 May 2018 08:28:04 +0000 Subject: [PATCH] Do not clear the value of st_dev in File I/O's stat() From: =?UTF-8?Q?Julio_Guerra?= To: =?UTF-8?Q?gdb-patches=40sourceware=2Eorg?= Cc: =?UTF-8?Q?Pedro_Alves?= , =?UTF-8?Q?Julio_Guerra?= Date: Thu, 17 May 2018 08:28:00 +0000 Mime-Version: 1.0 References: <20180517082631.26855-1-julio@farjump.io> X-Original-Mailer: git-send-email 2.17.0 Message-ID: <010201636d368a34-7edcde92-3661-4c9a-94b4-a894b9c8e90a-000000@eu-west-1.amazonses.com> X-SES-Outgoing: 2018.05.17-54.240.6.226 Feedback-ID: 1.eu-west-1.b24dn6frgCi6dh20skzbuMRr7UL8M6Soir/3ogtEjHQ=:AmazonSES X-IsSubscribed: yes Do not clear the value of st_dev in the fileio stat structure sent to the target. It prevents from being able to check the file type on the target. Note that the fileio function fstat `remote_fileio_func_fstat()` doesn't clear this field. 2018-05-16 Julio Guerra * remote-fileio.c: do not clear the value of st_dev in File I/O's stat(). Signed-off-by: Julio Guerra --- gdb/ChangeLog | 4 ++++ gdb/remote-fileio.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) -- 2.17.0 diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7217be67b6..34e7995e5a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2018-05-16 Julio Guerra + + * remote-fileio.c: do not clear the value of st_dev in File I/O's stat(). + 2018-05-16 Julio Guerra * remote-fileio.c: allow using File I/O function open() with special diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c index fa3cb15033..e855c682a0 100644 --- a/gdb/remote-fileio.c +++ b/gdb/remote-fileio.c @@ -870,7 +870,6 @@ remote_fileio_func_stat (char *buf) if (statptr) { host_to_fileio_stat (&st, &fst); - host_to_fileio_uint (0, fst.fst_dev); errno = target_write_memory (statptr, (gdb_byte *) &fst, sizeof fst); if (errno != 0)