aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-10-24 22:47:50 +0300
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-10-25 13:10:18 +0300
commita686277c725074ac3966396548789cd13fce3833 (patch)
tree38a3c5011fb7512b9aede4ac4779a80f8f17c538
parent683f1407398dd7b042c524b3fd27352c1eea113d (diff)
IPCDevice: check value returned from select()
Change-Id: I1c823317659547bb2391c57ac4d7931de1a383e3 Fxies: CID#240744
-rw-r--r--Transceiver52M/device/ipc/IPCDevice.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Transceiver52M/device/ipc/IPCDevice.cpp b/Transceiver52M/device/ipc/IPCDevice.cpp
index c1c6449..2e40aa3 100644
--- a/Transceiver52M/device/ipc/IPCDevice.cpp
+++ b/Transceiver52M/device/ipc/IPCDevice.cpp
@@ -839,6 +839,7 @@ void IPCDevice::manually_poll_sock_fds()
{
struct timeval wait = { 0, 100000 };
fd_set crfds, cwfds;
+ char err_buf[256];
int max_fd = 0;
FD_ZERO(&crfds);
@@ -853,7 +854,11 @@ void IPCDevice::manually_poll_sock_fds()
FD_SET(curr_fd->fd, &cwfds);
}
- select(max_fd + 1, &crfds, &cwfds, 0, &wait);
+ if (select(max_fd + 1, &crfds, &cwfds, 0, &wait) < 0) {
+ LOGP(DDEV, LOGL_ERROR, "select() failed: %s\n",
+ strerror_r(errno, err_buf, sizeof(err_buf)));
+ return;
+ }
for (unsigned int i = 0; i < chans; i++) {
int flags = 0;