Casper.Dik at Sun.COM wrote:
>> Renaud,
>>
>> Thanks for the feedback.
>>
>> The calls to closefrom(0) kept the hardcoded value to make explicit the 
>> intent of closing all file descriptors.
> 
> It seems indeed wrong to change that to closefrom(STDIN_FILENO) as the
> intention is to close all filedescriptors and they start at 0.  The intention
> is not to close all filedescriptors starting from STDIN_FILENO (even though
> I think it must always be defined as 0)

Sure.

With this fix if for any reason STDERR_FILENO wouldn't be equal to 2,
the call to closefrom(3) would be wrong.

-- Renaud

Reply via email to