Skip to content

Commit

Permalink
Fix setting pipe as nonblocking (#61126)
Browse files Browse the repository at this point in the history
  • Loading branch information
vtikoo committed Nov 26, 2021
1 parent 90b8c70 commit c00b068
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/coreclr/pal/src/debug/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,15 +742,19 @@ PAL_ProbeMemory(
BOOL fWriteAccess)
{
int fds[2];
int flags;

if (pipe(fds) != 0)
{
ASSERT("pipe failed: errno is %d (%s)\n", errno, strerror(errno));
return FALSE;
}

fcntl(fds[0], O_NONBLOCK);
fcntl(fds[1], O_NONBLOCK);
flags = fcntl(fds[0], F_GETFL, 0);
fcntl(fds[0], F_SETFL, flags | O_NONBLOCK);

flags = fcntl(fds[1], F_GETFL, 0);
fcntl(fds[1], F_SETFL, flags | O_NONBLOCK);

PVOID pEnd = (PBYTE)pBuffer + cbBuffer;
BOOL result = TRUE;
Expand Down

0 comments on commit c00b068

Please sign in to comment.