Re: Still more pty problems
Re: Still more pty problems
- Subject: Re: Still more pty problems
- From: Ingemar Ragnemalm <email@hidden>
- Date: Fri, 16 Sep 2011 22:12:37 +0200
Jonas Maebe <email@hidden> wrote
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
Thanks, but it doesn't explain why it would fail after a pretty exact
number of runs. And it still does, with the correction.
/Ingemar
_______________________________________________
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