diff options
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-02-23 16:04:15 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-02-23 16:04:15 +0100
commit4955a7ad5e6a89ea03d8d62bb2e0735c701624b9 (patch)
parent5ef117b03594402daa6d4e898a835a080c8d7cad (diff)
dvb-dev-remote: check if setsockopt() fails
Print an error if it can't adjust the size of the RCV buffer. As it might still work, let the code to continue. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libdvbv5/dvb-dev-remote.c b/lib/libdvbv5/dvb-dev-remote.c
index fdb936a5..79219d5c 100644
--- a/lib/libdvbv5/dvb-dev-remote.c
+++ b/lib/libdvbv5/dvb-dev-remote.c
@@ -1753,8 +1753,10 @@ int dvb_dev_remote_init(struct dvb_device *d, char *server, int port)
/* Set large buffer for read() to work better */
bufsize = REMOTE_BUF_SIZE;
- setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
- (void *)&bufsize, (int)sizeof(bufsize));
+ if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
+ (void *)&bufsize, (int)sizeof(bufsize))) {
+ dvb_perror("can't set buffer size");
+ }
/* Start receiving messsages from the server */
pthread_mutex_init(&priv->lock_io, NULL);

Privacy Policy