mirror of
https://github.com/rofafor/vdr-plugin-iptv.git
synced 2023-10-10 13:37:03 +02:00
Fixed ERROR_IF_FUNC macro.
This commit is contained in:
parent
c975d458f5
commit
29bc3d1493
17
common.h
17
common.h
@ -38,15 +38,14 @@
|
||||
|
||||
#define SECTION_FILTER_TABLE_SIZE 7
|
||||
|
||||
#define ERROR_IF_FUNC(exp, errstr, func, ret) \
|
||||
do { \
|
||||
if (exp) { \
|
||||
char tmp[64]; \
|
||||
strerror_r(errno, tmp, sizeof(tmp)); \
|
||||
error(errstr": %s", tmp); \
|
||||
func; \
|
||||
ret; \
|
||||
} \
|
||||
#define ERROR_IF_FUNC(exp, errstr, func, ret) \
|
||||
do { \
|
||||
if (exp) { \
|
||||
char tmp[64]; \
|
||||
error(errstr": %s", strerror_r(errno, tmp, sizeof(tmp))); \
|
||||
func; \
|
||||
ret; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
8
socket.c
8
socket.c
@ -227,7 +227,7 @@ int cIptvUdpSocket::Read(unsigned char* BufferAddr, unsigned int BufferLen)
|
||||
//debug("cIptvUdpSocket::Read()\n");
|
||||
// Error out if socket not initialized
|
||||
if (socketDesc <= 0) {
|
||||
error("Invalid socket in %s\n", __FUNCTION__);
|
||||
error("Invalid socket in cIptvUdpSocket::%s()\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
int len = 0;
|
||||
@ -359,7 +359,7 @@ int cIptvTcpSocket::Read(unsigned char* BufferAddr, unsigned int BufferLen)
|
||||
//debug("cIptvTcpSocket::Read()\n");
|
||||
// Error out if socket not initialized
|
||||
if (socketDesc <= 0) {
|
||||
error("Invalid socket in %s\n", __FUNCTION__);
|
||||
error("Invalid socket in cIptvTcpSocket::%s()\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
int len = 0;
|
||||
@ -376,7 +376,7 @@ bool cIptvTcpSocket::ReadChar(char* BufferAddr, unsigned int TimeoutMs)
|
||||
//debug("cIptvTcpSocket::ReadChar()\n");
|
||||
// Error out if socket not initialized
|
||||
if (socketDesc <= 0) {
|
||||
error("Invalid socket in %s\n", __FUNCTION__);
|
||||
error("Invalid socket in cIptvTcpSocket::%s()\n", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
socklen_t addrlen = sizeof(sockAddr);
|
||||
@ -401,7 +401,7 @@ bool cIptvTcpSocket::Write(const char* BufferAddr, unsigned int BufferLen)
|
||||
//debug("cIptvTcpSocket::Write()\n");
|
||||
// Error out if socket not initialized
|
||||
if (socketDesc <= 0) {
|
||||
error("Invalid socket in %s\n", __FUNCTION__);
|
||||
error("Invalid socket in cIptvTcpSocket::%s()\n", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
ERROR_IF_RET(send(socketDesc, BufferAddr, BufferLen, 0) < 0, "send()", return false);
|
||||
|
Loading…
Reference in New Issue
Block a user