Skip to content

Commit

Permalink
Ignore lastError() == 0 in Server::Listen()
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusTomlinson committed Jan 9, 2024
1 parent f84e961 commit db5a3f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/IpcServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class ServerImpl final
auto recvHeaderBytes = Receive( clientSocket );
if ( recvHeaderBytes.empty() )
{
if ( lastError() != EINVAL )
if ( lastError() != 0 && lastError() != EINVAL )
{
callback( Message( "", true ),
Message( "header recv() failed (error: " + std::to_string( lastError() ) + ")", true ) );
Expand Down
2 changes: 1 addition & 1 deletion tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ TEST( Ipc, PathTooLong )
{
callbackCalled = true;
EXPECT_TRUE( header.IsError() );
EXPECT_EQ( header.AsString(), "" );
EXPECT_TRUE( header.AsString().empty() );
EXPECT_TRUE( message.IsError() );
EXPECT_EQ( message.AsString(), std::string( "socket path too long: " ) + longPath );
return Ipc::Message( "" );
Expand Down

0 comments on commit db5a3f5

Please sign in to comment.