summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/miscfuncs.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-08-19 14:56:48 +0000
committerChristopher Faylor <me@cgf.cx>2005-08-19 14:56:48 +0000
commitbabc4e5424c9c850d6e7111f98edc40f5282c507 (patch)
tree92d9801b3252e58b67561cb6114a1fec47878416 /winsup/cygwin/miscfuncs.cc
parent4fa0a3986528b8a68956edeb96de85e3df68fe5b (diff)
downloadcygnal-babc4e5424c9c850d6e7111f98edc40f5282c507.tar.gz
cygnal-babc4e5424c9c850d6e7111f98edc40f5282c507.tar.bz2
cygnal-babc4e5424c9c850d6e7111f98edc40f5282c507.zip
* 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;
+}