mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Got rid of scan-build warnings.
This commit is contained in:
parent
3d1efe7a80
commit
ab2a47e3e7
@ -233,7 +233,7 @@ void cSatipDiscover::AddServer(const char *addrP, const char *modelP, const char
|
||||
{
|
||||
debug1("%s (%s, %s, %s)", __PRETTY_FUNCTION__, addrP, modelP, descP);
|
||||
cMutexLock MutexLock(&mutexM);
|
||||
if (SatipConfig.GetUseSingleModelServers()) {
|
||||
if (SatipConfig.GetUseSingleModelServers() && modelP && !isempty(modelP)) {
|
||||
int n = 0;
|
||||
char *s, *p = strdup(modelP);
|
||||
char *r = strtok_r(p, ",", &s);
|
||||
|
2
param.c
2
param.c
@ -192,7 +192,7 @@ cString GetTransponderUrlParameters(const cChannel *channelP)
|
||||
ST(" T*") q += PrintUrlString(q, STBUFLEFT, dtp.System(), SatipSystemValuesTerrestrial);
|
||||
ST(" T*") q += PrintUrlString(q, STBUFLEFT, dtp.Transmission(), SatipTransmissionValues);
|
||||
if ((channelP->Rid() % 100) > 0)
|
||||
q += snprintf(q, STBUFLEFT, "&fe=%d", channelP->Rid() % 100);
|
||||
snprintf(q, STBUFLEFT, "&fe=%d", channelP->Rid() % 100);
|
||||
#undef ST
|
||||
return buffer;
|
||||
}
|
||||
|
11
socket.c
11
socket.c
@ -136,12 +136,17 @@ int cSatipSocket::Read(unsigned char *bufferAddrP, unsigned int bufferLenP)
|
||||
int cSatipSocket::ReadMulti(unsigned char *bufferAddrP, unsigned int *elementRecvSizeP, unsigned int elementCountP, unsigned int elementBufferSizeP)
|
||||
{
|
||||
debug16("%s (, , %d, %d)", __PRETTY_FUNCTION__, elementCountP, elementBufferSizeP);
|
||||
#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,12)
|
||||
int count = -1;
|
||||
// Error out if socket not initialized
|
||||
if (socketDescM <= 0) {
|
||||
error("%s Invalid socket", __PRETTY_FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
if (!bufferAddrP || !elementRecvSizeP || !elementCountP || !elementBufferSizeP) {
|
||||
error("%s Invalid parameter(s)", __PRETTY_FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,12)
|
||||
// Initialize iov and msgh structures
|
||||
struct mmsghdr mmsgh[elementCountP];
|
||||
struct iovec iov[elementCountP];
|
||||
@ -154,14 +159,12 @@ int cSatipSocket::ReadMulti(unsigned char *bufferAddrP, unsigned int *elementRec
|
||||
}
|
||||
|
||||
// Read data from socket as a set
|
||||
int count = -1;
|
||||
if (socketDescM && bufferAddrP && elementRecvSizeP && (elementCountP > 0) && (elementBufferSizeP > 0))
|
||||
count = (int)recvmmsg(socketDescM, mmsgh, elementCountP, MSG_DONTWAIT, NULL);
|
||||
ERROR_IF_RET(count < 0 && errno != EAGAIN && errno != EWOULDBLOCK, "recvmmsg()", return -1);
|
||||
for (int i = 0; i < count; ++i)
|
||||
elementRecvSizeP[i] = mmsgh[i].msg_len;
|
||||
#else
|
||||
int count = 0;
|
||||
count = 0;
|
||||
while (count < (int)elementCountP) {
|
||||
int len = Read(bufferAddrP + count * elementBufferSizeP, elementBufferSizeP);
|
||||
if (len < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user