Skip to content

Commit

Permalink
Fix: Check for error being EPIPE only if an error actually occurred
Browse files Browse the repository at this point in the history
  • Loading branch information
dgreatwood committed Sep 10, 2024
1 parent 6601b8f commit 15a486b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ on:
push:
branches:
- master
- macOSRunner
- ErrnoNotEPIPEServerTest
pull_request:
branches:
- master
- macOSRunner
- ErrnoNotEPIPEServerTest

defaults:
run:
Expand Down
2 changes: 2 additions & 0 deletions tests/http_server_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,8 @@ TEST(http_server_test, client_request_timeout_on_delay_in_request_line_send_rais

if (send_failed)
{ // Usually, send does fail; but on macOS occasionally it does not fail
// We workaround that here, since of course we can only check for an
// error code when there is an actual error
EXPECT_EQ(client.lastErrno(), EPIPE) << "Errno: " << client.lastErrno();

char recvBuf[1024] = {
Expand Down
2 changes: 1 addition & 1 deletion tests/tcp_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// In CLIENT_TRY, note that strerror is allowed to change errno in certain
// circumstances, so we must save errno in lastErrno_ BEFORE we call strerror
//
//
// Secondly, if errno has not been set at all then we set lastErrno_ =
// ECANCELED; the ECANCELED errno is not used in Pistache code as of Aug/2024.
static const char * strerror_errstr = "<no strerror>";
Expand Down

0 comments on commit 15a486b

Please sign in to comment.