* winsup.h (create_pipe): Declare new function.

(CreatePipe): New define.
* miscfuncs.cc (create_pipe): Define new function.
This commit is contained in:
Christopher Faylor
2005-08-19 14:56:48 +00:00
parent 4fa0a39865
commit babc4e5424
3 changed files with 24 additions and 0 deletions

View File

@ -347,3 +347,17 @@ nice_to_winprio (int &nice)
prio = NORMAL_PRIORITY_CLASS;
return prio;
}
#undef CreatePipe
bool
create_pipe (PHANDLE hr,PHANDLE hw, LPSECURITY_ATTRIBUTES sa, DWORD n)
{
for (int i = 0; i < 10; i++)
if (CreatePipe (hr, hw, sa, n))
return true;
else if (GetLastError () == ERROR_PIPE_BUSY && i < 9)
Sleep (10);
else
break;
return false;
}