apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yuri V. Vishnevskiy" <yuri.vishnevs...@gmail.com>
Subject Re: Crash in apr_file_close() (Linux)
Date Fri, 16 Oct 2009 09:22:20 GMT
On Fri, 16 Oct 2009 15:39:49 +0700, Joe Orton <jorton@redhat.com> wrote:

> On Fri, Oct 16, 2009 at 03:26:31PM +0700, Yuri V. Vishnevskiy wrote:
>> Dear developers,
>> For some reason in my program I need two file handlers of stdout stream.
>> When I close these handlers I obtain an error on the second close: "Bad
>> file descriptor"
>
> It seems like reasonable behaviour that the second apr_file_close() call
> should fail, though it certainly isn't obvious from reading the docs.
> How else do you expect it to behave?  You cannot close an fd twice.

I understand that very clearly. What I do not understand well is the APR  
file API policy, since apr_file_ functions are general for both usual  
files and std*.

Mime
View raw message