diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2005-12-20 20:19:55 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2005-12-20 20:19:55 +0000 |
commit | 56c07aa2ce1cde43eda6928fdad1e19140efc8be (patch) | |
tree | 29cc8551695058405ad44f1a5491085a3bfb5d73 /winsup/cygwin/miscfuncs.cc | |
parent | 7c578a4fa0f56b7ab84755933ab88cb9fcfc172b (diff) | |
download | cygnal-56c07aa2ce1cde43eda6928fdad1e19140efc8be.tar.gz cygnal-56c07aa2ce1cde43eda6928fdad1e19140efc8be.tar.bz2 cygnal-56c07aa2ce1cde43eda6928fdad1e19140efc8be.zip |
* winsup.h (flush_file_buffers): Declare new function.
(FLushFileBuffers): New define.
* miscfuncs.cc (flush_file_buffers): Define new function.
Diffstat (limited to 'winsup/cygwin/miscfuncs.cc')
-rw-r--r-- | winsup/cygwin/miscfuncs.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc index 26686bd2b..474843a19 100644 --- a/winsup/cygwin/miscfuncs.cc +++ b/winsup/cygwin/miscfuncs.cc @@ -361,3 +361,14 @@ create_pipe (PHANDLE hr,PHANDLE hw, LPSECURITY_ATTRIBUTES sa, DWORD n) break; return false; } + +#undef FlushFileBuffers +bool +flush_file_buffers (HANDLE h) +{ + DWORD ftype = GetFileType (h); + /* Per MSDN, FlushFileBuffers on named pipes might block. This is the last + we want it to do, especially when printing debug output as when calling + system_printf. */ + return (ftype != FILE_TYPE_PIPE) ? FlushFileBuffers (h) : true; +} |