From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8773 invoked by alias); 15 Dec 2012 12:44:11 -0000 Received: (qmail 8742 invoked by uid 22791); 15 Dec 2012 12:44:10 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cc-smtpout3.netcologne.de (HELO cc-smtpout3.netcologne.de) (89.1.8.213) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 15 Dec 2012 12:44:06 +0000 Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout3.netcologne.de (Postfix) with ESMTP id B172112541; Sat, 15 Dec 2012 13:44:04 +0100 (CET) Received: from [192.168.0.104] (xdsl-78-35-146-188.netcologne.de [78.35.146.188]) by cc-smtpin1.netcologne.de (Postfix) with ESMTPSA id 8096211DBD; Sat, 15 Dec 2012 13:44:02 +0100 (CET) Message-ID: <50CC7091.4020104@netcologne.de> Date: Sat, 15 Dec 2012 12:44:00 -0000 From: Thomas Koenig User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Janus Weil CC: "fortran@gcc.gnu.org" , gcc-patches Subject: Re: [patch, libfortran] Fix PR 30162, write with pipes References: <50CC5A5B.8030603@netcologne.de> In-Reply-To: Content-Type: multipart/mixed; boundary="------------080306020604020502080203" Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg01006.txt.bz2 This is a multi-part message in MIME format. --------------080306020604020502080203 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 679 Hi Janus, Oops, right. Here is the correct one. Regards Thomas > wrong patch attached? It contains a hunk in frontend-passes.c, which > seems totally unrelated ... > > Cheers, > Janus > > > > 2012/12/15 Thomas Koenig : >> Hello world, >> >> the attached patch fixes the regression and regtests cleanly. >> No test case because I could not find anything portable >> to create a FIFO in the testsuite. >> >> OK for trunk and 4.7? >> >> Thomas >> >> 2012-12-15 Thomas Koenig >> >> PR libfortran/30162 >> * io/unix.c (raw_tell): If the lseek is done on a >> non-seekable file, return 0. >> > --------------080306020604020502080203 Content-Type: text/x-patch; name="p1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="p1.diff" Content-length: 482 Index: io/unix.c =================================================================== --- io/unix.c (Revision 194507) +++ io/unix.c (Arbeitskopie) @@ -344,7 +344,15 @@ static gfc_offset raw_tell (unix_stream * s) { - return lseek (s->fd, 0, SEEK_CUR); + gfc_offset x; + x = lseek (s->fd, 0, SEEK_CUR); + + /* Non-seekable files should always be assumed to be at + current position. */ + if (x == -1 && errno == ESPIPE) + x = 0; + + return x; } static gfc_offset --------------080306020604020502080203--