Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-08-19 18:56:48 +0400
committerChristopher Faylor <me@cgf.cx>2005-08-19 18:56:48 +0400
commitbabc4e5424c9c850d6e7111f98edc40f5282c507 (patch)
tree92d9801b3252e58b67561cb6114a1fec47878416 /winsup/cygwin/miscfuncs.cc
parent4fa0a3986528b8a68956edeb96de85e3df68fe5b (diff)
* winsup.h (create_pipe): Declare new function.
(CreatePipe): New define. * miscfuncs.cc (create_pipe): Define new function.
Diffstat (limited to 'winsup/cygwin/miscfuncs.cc')
-rw-r--r--winsup/cygwin/miscfuncs.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index 18e8bb103..26686bd2b 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -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;
+}