mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-22 15:15:28 +00:00
Check return of read() and write() to prevent g++ warning
This commit is contained in:
@ -64,7 +64,9 @@ int SelectInterrupter::prepare(fd_set &readfds, [[maybe_unused]] fd_set &writefd
|
|||||||
return SOCKET_TO_INT(mDummySock) + 1;
|
return SOCKET_TO_INT(mDummySock) + 1;
|
||||||
#else
|
#else
|
||||||
char dummy;
|
char dummy;
|
||||||
(void)::read(mPipeIn, &dummy, 1);
|
if (::read(mPipeIn, &dummy, 1) < 0 && errno != EAGAIN && errno != EWOULDBLOCK) {
|
||||||
|
PLOG_WARNING << "Reading from interrupter pipe failed, errno=" << errno;
|
||||||
|
}
|
||||||
FD_SET(mPipeIn, &readfds);
|
FD_SET(mPipeIn, &readfds);
|
||||||
return mPipeIn + 1;
|
return mPipeIn + 1;
|
||||||
#endif
|
#endif
|
||||||
@ -79,7 +81,9 @@ void SelectInterrupter::interrupt() {
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
char dummy = 0;
|
char dummy = 0;
|
||||||
(void)::write(mPipeOut, &dummy, 1);
|
if (::write(mPipeOut, &dummy, 1) < 0 && errno != EAGAIN && errno != EWOULDBLOCK) {
|
||||||
|
PLOG_WARNING << "Writing to interrupter pipe failed, errno=" << errno;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user