[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: PATCH: file:close() return-value for pipes
- From: David Favro <lua@...>
- Date: Wed, 19 Jan 2011 08:23:57 -0500
On 01/19/2011 06:22 AM, Luiz Henrique de Figueiredo wrote:
>> This is really two changes, one which fixes the just-plain-wrong behavior of
>> the return-value of file:close() when called on a pipe on Linux (and
>> presumably also other posix platforms)
>
> Thanks for your patch but Lua targets ANSI C platforms not POSIX.
> We prefer to avoid #ifdefs in the main code.
I'm not sure what ANSI C describes for the return-value of pclose(), but
your own manual says that the return-value of file:close() will be the exit
status of the child process; your own code returns something other than
that. That's the definition of a bug.