This commit is contained in:
Benjamin Sergeant
2019-03-15 11:41:57 -07:00
parent 6ff8c6e7f3
commit 3a9cc9b079
7 changed files with 20 additions and 13 deletions

View File

@ -25,7 +25,8 @@ namespace ix
SelectInterruptPipe::SelectInterruptPipe()
{
;
_fildes[kPipeReadIndex] = -1;
_fildes[kPipeWriteIndex] = -1;
}
SelectInterruptPipe::~SelectInterruptPipe()
@ -38,8 +39,9 @@ namespace ix
bool SelectInterruptPipe::init(std::string& errorMsg)
{
_fildes[kPipeReadIndex] = -1;
_fildes[kPipeWriteIndex] = -1;
// calling init twice is a programming error
assert(_fildes[kPipeReadIndex] == -1);
assert(_fildes[kPipeWriteIndex] == -1);
if (pipe(_fildes) < 0)
{
@ -101,7 +103,7 @@ namespace ix
return true;
}
int SelectInterruptPipe::getFd()
int SelectInterruptPipe::getFd() const
{
return _fildes[kPipeReadIndex];
}