Avoid warnings about not checking read() result in wxJoystick code.

Explicitly ignore errors if we can't read from the associated FD.

This is mostly done to avoid -Wunused-result warning about not checking read()
return value under Ubuntu.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78481 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2015-02-12 21:56:36 +00:00
parent 3f6741a770
commit a74d2faf3a

View File

@@ -129,7 +129,12 @@ void* wxJoystickThread::Entry()
if (wxFD_ISSET(m_device, &read_fds))
{
memset(&j_evt, 0, sizeof(j_evt));
read(m_device, &j_evt, sizeof(j_evt));
if ( read(m_device, &j_evt, sizeof(j_evt)) == -1 )
{
// We can hardly do anything other than ignoring the error and
// hope that we read the next event successfully.
continue;
}
//printf("time: %d\t value: %d\t type: %d\t number: %d\n",
// j_evt.time, j_evt.value, j_evt.type, j_evt.number);