Re: Still more pty problems
Re: Still more pty problems
- Subject: Re: Still more pty problems
- From: Jonas Maebe <email@hidden>
- Date: Fri, 16 Sep 2011 15:02:12 +0200
On 16 Sep 2011, at 14:49, email@hidden wrote:
void RunTest(int i)
{
int pty;
switch(forkpty(&pty, NULL, NULL, NULL))
{
case -1: // Error
printf("pty error after %d\n", i); exit(1);
case 0: // Child
_exit(0);
default: // Parent
close(pty);
}
One error here: close can be interrupted, so you need
int res;
do
{
res = close(pty);
} while ((res == -1) && (errno == EINTR));
Jonas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden