From: Thomas Koenig <tkoenig@netcologne.de>
To: Janus Weil <janus@gcc.gnu.org>
Cc: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [patch, libfortran] Fix PR 30162, write with pipes
Date: Sat, 15 Dec 2012 12:44:00 -0000 [thread overview]
Message-ID: <50CC7091.4020104@netcologne.de> (raw)
In-Reply-To: <CAKwh3qgEMjx0Z4=QNQf2n=r-cGMtHuisYUcwSz98SZmHUprKvA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 679 bytes --]
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 <tkoenig@netcologne.de>:
>> 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 <tkoenig@gcc.gnu.org>
>>
>> PR libfortran/30162
>> * io/unix.c (raw_tell): If the lseek is done on a
>> non-seekable file, return 0.
>>
>
[-- Attachment #2: p1.diff --]
[-- Type: text/x-patch, Size: 482 bytes --]
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
next prev parent reply other threads:[~2012-12-15 12:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-15 11:09 Thomas Koenig
2012-12-15 12:32 ` Janus Weil
2012-12-15 12:44 ` Thomas Koenig [this message]
2012-12-20 11:23 ` *ping* " Thomas Koenig
2012-12-21 20:41 ` Jerry DeLisle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50CC7091.4020104@netcologne.de \
--to=tkoenig@netcologne.de \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=janus@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).