public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Janne Blomqvist <blomqvist.janne@gmail.com>
To: Jerry DeLisle <jvdelisle@charter.net>
Cc: Steve Kargl <sgk@troutmask.apl.washington.edu>,
	Fortran List <fortran@gcc.gnu.org>,
		GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [Fortran, committed] XFAIL read_dir.f90 on FreeBSD
Date: Wed, 02 Sep 2015 08:30:00 -0000	[thread overview]
Message-ID: <CAO9iq9EWU8VF5jwkqTFdf8GwAZ1a9b-+7w7XB8kgwO=7Vwmjkw@mail.gmail.com> (raw)
In-Reply-To: <55E62694.5000207@charter.net>

On Wed, Sep 2, 2015 at 1:28 AM, Jerry DeLisle <jvdelisle@charter.net> wrote:
> On 09/01/2015 11:18 AM, Steve Kargl wrote:
>> On Tue, Sep 01, 2015 at 11:16:27AM -0700, Steve Kargl wrote:
>>>     open(unit=10, file='junko.dir',iostat=ios,action='read',access='stream')
>>>     if (ios.ne.0) call abort
>>>     read(10, iostat=ios) c
>>> -   if (ios.ne.21) call abort
>>> +   if (ios.ne.21) then
>>> +      close(10)
>>
>> I forgot to mention that 'close(10, status="delete')' does not
>> work on a directory.  Should it?
>>
>>> +      call system('rmdir junko.dir')
>>> +      call abort
>>> +   end if
>>> +   close(10)
>>>     call system('rmdir junko.dir')
>>
>
> Thanks for the touch up Steve.  I suspect other OS's will not work either.  I
> assumed close with Status="delete" would not work on a directory.

That's because libgfortran uses unlink(2), which only works for files,
not directories. One could change that to use remove(3), which works
for both.

Also, I suspect the reason why it fails on freebsd is that errno
EISDIR is not 21 there. Perhaps one should just check for ios /= 0?
Unfortunately the __linux__ define isn't available since the switch to
cpp (IIRC there is a PR for that), so it's not that straightforward to
check which platform one runs on.

-- 
Janne Blomqvist

  reply	other threads:[~2015-09-02  8:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 18:16 Steve Kargl
2015-09-01 18:18 ` Steve Kargl
2015-09-01 22:28   ` Jerry DeLisle
2015-09-02  8:30     ` Janne Blomqvist [this message]
2015-09-02 15:03       ` Steve Kargl
2015-09-03 21:58         ` Janne Blomqvist

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='CAO9iq9EWU8VF5jwkqTFdf8GwAZ1a9b-+7w7XB8kgwO=7Vwmjkw@mail.gmail.com' \
    --to=blomqvist.janne@gmail.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jvdelisle@charter.net \
    --cc=sgk@troutmask.apl.washington.edu \
    /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).