On 21.11.2015 2:20, Andrey Chernov wrote:
> On 21.11.2015 1:36, Ravi Pokala wrote:
>>   Move fdopen() up near other resource allocation like malloc(); do proper
>>   deallocation on failure later on in the function.
> 
> Incorrect. Old code calls fdopen() only in the parent, new one calls
> fdopen() before fork(), so its results shared by both parent and child,
> which is wrong for child() case.
> 

To be specific, fdopen() may set FD_CLOEXEC for the _child_, for
example. I don't have a time right now to check what happens in that
case, but it looks suspicious.

IMHO it will be better to add fdopen() error processing in the parent,
leaving fdopen() where it was.

-- 
http://ache.vniz.net/
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to