1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 11:37:03 +00:00

Reduce duplicated code by using an error -macro.

This commit is contained in:
Antti Seppälä
2007-10-20 23:16:28 +00:00
parent 30409fac2c
commit 64dd6a5f3f
7 changed files with 48 additions and 144 deletions

View File

@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: sectionfilter.c,v 1.13 2007/10/20 20:43:22 ajhseppa Exp $
* $Id: sectionfilter.c,v 1.14 2007/10/20 23:16:28 ajhseppa Exp $
*/
#include "sectionfilter.h"
@@ -56,11 +56,7 @@ cIptvSectionFilter::cIptvSectionFilter(int Index, int devInd,
if (S_ISFIFO(sb.st_mode))
unlink(pipeName);
int err = mknod(pipeName, 0644 | S_IFIFO, 0);
if (err < 0) {
char tmp[64];
error("ERROR: mknod(): %s", strerror_r(errno, tmp, sizeof(tmp)));
return;
}
ERROR_IF(err < 0, "mknod()", return);
// Create descriptors
fifoDescriptor = open(pipeName, O_RDWR | O_NONBLOCK);
@@ -108,10 +104,7 @@ int cIptvSectionFilter::dmxdev_section_callback(const uint8_t *buffer1, size_t b
printf("\n");
#endif
retval = write(fifoDescriptor, buffer1, buffer1_len);
if (retval < 0) {
char tmp[64];
error("ERROR: write(): %s", strerror_r(errno, tmp, sizeof(tmp)));
}
ERROR_IF(retval < 0, "write()", );
// Update statistics
AddStatistic(retval, 1);
}