Skip to content

Commit

Permalink
Update IXSelectInterruptPipe.cpp (#502)
Browse files Browse the repository at this point in the history
Valgrind keeps complaining that close() on the invalid descriptor -1 is happening here. I suppose that close shouldn't be called when the descriptor value is known to be invalid. It's not a fatal error or something, but this practice is able to create a lot of flood in the logs.
  • Loading branch information
CryptoManiac authored Mar 19, 2024
1 parent 39e085b commit 98b4828
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ixwebsocket/IXSelectInterruptPipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ namespace ix

SelectInterruptPipe::~SelectInterruptPipe()
{
::close(_fildes[kPipeReadIndex]);
::close(_fildes[kPipeWriteIndex]);
if (-1 != _fildes[kPipeReadIndex]) {
::close(_fildes[kPipeReadIndex]);
}
if (-1 != _fildes[kPipeWriteIndex]) {
::close(_fildes[kPipeWriteIndex]);
}
_fildes[kPipeReadIndex] = -1;
_fildes[kPipeWriteIndex] = -1;
}
Expand Down

0 comments on commit 98b4828

Please sign in to comment.