Merge pull request #283 from weili-jiang/fix-wunused-result

Check pipe writes in linux_tcp to suppress Wunused-result in GCC
This commit is contained in:
Emiel Bruijntjes 2019-02-05 00:03:18 +01:00 committed by GitHub
commit 180eae10b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -75,14 +75,15 @@ public:
/**
* Notify the pipe, so that the other thread wakes up
* @return bool success/failure (errno is set on failure)
*/
void notify()
bool notify()
{
// one byte to send
char byte = 0;
// send one byte over the pipe - this will wake up the other thread
write(_fds[1], &byte, 1);
return write(_fds[1], &byte, 1) == 1;
}
};

View File

@ -138,7 +138,10 @@ private:
}
// notify the master thread by sending a byte over the pipe
_pipe.notify();
if (!_pipe.notify())
{
_error = strerror(errno);
}
}
public: