Change in osmo-trx[master]: IPCDevice: check value returned from select()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Tue Oct 26 16:17:32 UTC 2021


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/25923 )

Change subject: IPCDevice: check value returned from select()
......................................................................

IPCDevice: check value returned from select()

Change-Id: I1c823317659547bb2391c57ac4d7931de1a383e3
Fxies: CID#240744
---
M Transceiver52M/device/ipc/IPCDevice.cpp
1 file changed, 6 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved



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 @@
 {
 	struct timeval wait = { 0, 100000 };
 	fd_set crfds, cwfds;
+	char err_buf[256];
 	int max_fd = 0;
 
 	FD_ZERO(&crfds);
@@ -853,7 +854,11 @@
 			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;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/25923
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I1c823317659547bb2391c57ac4d7931de1a383e3
Gerrit-Change-Number: 25923
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211026/bc13eacd/attachment.htm>


More information about the gerrit-log mailing list