From patchwork Wed Oct 22 05:43:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 3320 Received: (qmail 9144 invoked by alias); 22 Oct 2014 05:47:52 -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 9017 invoked by uid 89); 22 Oct 2014 05:47:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Oct 2014 05:47:50 +0000 Received: from svr-orw-fem-06.mgc.mentorg.com ([147.34.97.120]) by relay1.mentorg.com with esmtp id 1Xgolv-0007Vn-N1 from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Tue, 21 Oct 2014 22:47:47 -0700 Received: from qiyao.dyndns.org.com (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.3.181.6; Tue, 21 Oct 2014 22:47:47 -0700 From: Yao Qi To: Subject: [PATCH 1/2] Close the file in fileio.exp test Date: Wed, 22 Oct 2014 13:43:36 +0800 Message-ID: <1413956617-3979-2-git-send-email-yao@codesourcery.com> In-Reply-To: <1413956617-3979-1-git-send-email-yao@codesourcery.com> References: <1413956617-3979-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes I see the following fail in fileio.exp on mingw32 host gdb, rename 1: ret = -1, errno = 13^M ^M Breakpoint 2, stop () at fileio.c:76^M 76 static void stop () {}^M (gdb) FAIL: gdb.base/fileio.exp: Rename a file the test fails to rename a file which is not expected. The previous test test_write doesn't close the file, so the rename fails as a result on Windows. This patch fixes it by closing file in test_write, and the fail goes away. rename 1: ret = 0, errno = 0 OK^M ^M Breakpoint 2, stop () at fileio.c:76^M 76 static void stop () {}^M (gdb) PASS: gdb.base/fileio.exp: Rename a file gdb/testsuite: 2014-10-22 Yao Qi * gdb.base/fileio.c (test_write): Close the file. --- gdb/testsuite/gdb.base/fileio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c index b8c2698..29c32e0 100644 --- a/gdb/testsuite/gdb.base/fileio.c +++ b/gdb/testsuite/gdb.base/fileio.c @@ -169,6 +169,7 @@ test_write () ret = write (fd, STRING, strlen (STRING)); printf ("write 3: ret = %d, errno = %d %s\n", ret, errno, strerrno (errno)); + close (fd); } else printf ("write 3: ret = %d, errno = %d\n", ret, errno);