diff options
author | Takashi Yano <takashi.yano@nifty.ne.jp> | 2021-11-11 12:30:24 +0900 |
---|---|---|
committer | Takashi Yano <takashi.yano@nifty.ne.jp> | 2021-11-11 14:02:19 +0900 |
commit | 576ace1f2f977342b837d2da3a23c5c9b0f61af1 (patch) | |
tree | 6286012d709fedd2ff51c35c0fc703f09f4fe1c7 /winsup | |
parent | 24491c1251d4b8711ce5fa577e16ed01c46db7a6 (diff) | |
download | newlib-576ace1f2f977342b837d2da3a23c5c9b0f61af1.zip newlib-576ace1f2f977342b837d2da3a23c5c9b0f61af1.tar.gz newlib-576ace1f2f977342b837d2da3a23c5c9b0f61af1.tar.bz2 |
Cygwin: pipe: Fix raw_write() for non-cygwin pipe with size zero.
- Currently, raw_write() fails to handle size zero pipe which may
be created by non-cygwin apps (e.g. Windows native ninja). This
patch fixes the issue.
Addresses:
https://cygwin.com/pipermail/cygwin/2021-November/249844.html
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/fhandler_pipe.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_pipe.cc b/winsup/cygwin/fhandler_pipe.cc index 1373143..9392a28 100644 --- a/winsup/cygwin/fhandler_pipe.cc +++ b/winsup/cygwin/fhandler_pipe.cc @@ -449,7 +449,7 @@ fhandler_pipe_fifo::raw_write (const void *ptr, size_t len) return -1; } - if (len <= pipe_buf_size) + if (len <= pipe_buf_size || pipe_buf_size == 0) chunk = len; else if (is_nonblocking ()) chunk = len = pipe_buf_size; |