check for fd exhaustion in forkpty
authorRich Felker <dalias@aerifal.cx>
Fri, 22 Jul 2011 04:25:56 +0000 (00:25 -0400)
committerRich Felker <dalias@aerifal.cx>
Fri, 22 Jul 2011 04:25:56 +0000 (00:25 -0400)
we cannot report failure after forking, so the idea is to ensure prior
to fork that fd 0,1,2 exist. this will prevent dup2 from possibly
hitting a resource limit and failing in the child process. fcntl
rather than dup2 is used prior to forking to avoid race conditions.


No differences found