diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-02-23 16:04:15 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-02-23 16:04:15 +0100 |
commit | 4955a7ad5e6a89ea03d8d62bb2e0735c701624b9 (patch) | |
tree | bb4ba11cd8dfae2fda3dfce8b90a1eefac3679d5 | |
parent | 5ef117b03594402daa6d4e898a835a080c8d7cad (diff) | |
download | v4l-utils-4955a7ad5e6a89ea03d8d62bb2e0735c701624b9.tar.gz |
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>
-rw-r--r-- | lib/libdvbv5/dvb-dev-remote.c | 6 |
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); |