Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cygwin: pipe: Fix a regression that raw_write() slows down #227

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions winsup/cygwin/fhandler/pipe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -503,15 +503,17 @@ fhandler_pipe_fifo::raw_write (const void *ptr, size_t len)
raise (SIGPIPE);
goto out;
}
else
cygwait (select_sem, 10, cw_cancel);
/* Break out on completion */
if (waitret == WAIT_OBJECT_0)
break;
/* If we got a timeout in the blocking case, and we already
did a short write, we got a signal in the previous loop. */
if (waitret == WAIT_TIMEOUT && short_write_once)
{
waitret = WAIT_SIGNALED;
break;
}
cygwait (select_sem, 10, cw_cancel);
}
/* Loop in case of blocking write or SA_RESTART */
while (waitret == WAIT_TIMEOUT || waitret == WAIT_SIGNALED);
Expand Down