From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23979 invoked by alias); 20 Jun 2008 04:42:10 -0000 Received: (qmail 23968 invoked by uid 22791); 20 Jun 2008 04:42:10 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate6.de.ibm.com (HELO mtagate6.de.ibm.com) (195.212.29.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 20 Jun 2008 04:41:37 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.13.8/8.13.8) with ESMTP id m5K4ek2j482256 for ; Fri, 20 Jun 2008 04:40:46 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m5K4ekBB2850818 for ; Fri, 20 Jun 2008 06:40:46 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m5K4ekfn018087 for ; Fri, 20 Jun 2008 06:40:46 +0200 Received: from bbkeks.de.ibm.com (dyn-9-152-248-45.boeblingen.de.ibm.com [9.152.248.45]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m5K4eiIZ018077 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Jun 2008 06:40:46 +0200 Message-ID: <485B34CC.70401@de.ibm.com> Date: Fri, 20 Jun 2008 12:23:00 -0000 From: Markus Deuling User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Ulrich Weigand CC: GDB Patches Subject: [patch]: Improve spu-info testcase Content-Type: multipart/mixed; boundary="------------080605000606020703070603" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00359.txt.bz2 This is a multi-part message in MIME format. --------------080605000606020703070603 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Content-length: 590 Hello, if multiple users on the same machine run the testsuite for spu-gdb, gdb.arch/spu-info will fail because of access priviliges to the temporary file. This file is created in /var/tmp currently. With this patch I changed the naming of the file (using speid to seperate different runs) and the location (user dir). Ok ? ChangeLog: * gdb.arch/spu-info.c (do_dma_test): Add speid paramter. Change name of temporary file to include speid. Delete it after use. (main): Update call to do_dma_test. -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com --------------080605000606020703070603 Content-Type: text/plain; name="diff-spu-info" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff-spu-info" Content-length: 1329 diff -urpN src-orig/gdb/testsuite/gdb.arch/spu-info.c src/gdb/testsuite/gdb.arch/spu-info.c --- src-orig/gdb/testsuite/gdb.arch/spu-info.c 2008-01-01 23:53:18.000000000 +0100 +++ src/gdb/testsuite/gdb.arch/spu-info.c 2008-06-20 06:32:20.000000000 +0200 @@ -124,19 +124,20 @@ do_event_test () } int -do_dma_test () +do_dma_test (unsigned long long speid) { #define MAP_FAILED (-1ULL) #define PROT_READ 0x1 #define MAP_PRIVATE 0x002 #define BSIZE 128 static char buf[BSIZE] __attribute__ ((aligned (128))); - char *file = "/var/tmp/tmp_buf"; + char file[32]; struct stat fdstat; int fd, cnt; unsigned long long src; /* Create a file and fill it with some bytes. */ + snprintf (file, sizeof(file), "tmp_buf_%lld", speid); fd = open (file, O_CREAT | O_RDWR | O_TRUNC, 0777); if (fd == -1) return -1; @@ -158,8 +159,9 @@ do_dma_test () mfc_write_tag_mask (1<<5); /* Marker DMAWait */ spu_mfcstat (MFC_TAG_UPDATE_ALL); - /* Close the file. */ + /* Close and delete the file. */ close (fd); + unlink (file); return cnt; } @@ -221,7 +223,7 @@ main (unsigned long long speid, unsigned res = do_event_test (); /* info spu dma */ - res = do_dma_test (); + res = do_dma_test (speid); /* info spu mailbox */ res = do_mailbox_test (); --------------080605000606020703070603--