mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Changed the [dei]syslog macros to use var args; fixed error handling in establishing an SVDRP connection
This commit is contained in:
parent
2a31a4eca8
commit
ddec0a101b
@ -182,3 +182,6 @@ Sergei Haller <Sergei.Haller@math.uni-giessen.de>
|
|||||||
|
|
||||||
Andreas Gebel <andreas@xcapenet.de>
|
Andreas Gebel <andreas@xcapenet.de>
|
||||||
for his help in keeping 'channels.conf' up to date
|
for his help in keeping 'channels.conf' up to date
|
||||||
|
|
||||||
|
Davide Achilli <davide@objsystem.it>
|
||||||
|
for pointing out a bug in error handling while establishing an SVDRP connection
|
||||||
|
4
HISTORY
4
HISTORY
@ -946,3 +946,7 @@ Video Disk Recorder Revision History
|
|||||||
data is cleaned up and when VDR is terminated). Maybe somebody in charge of
|
data is cleaned up and when VDR is terminated). Maybe somebody in charge of
|
||||||
the EPG data at the listed channels will read this and take the necessary
|
the EPG data at the listed channels will read this and take the necessary
|
||||||
actions to fix these things...
|
actions to fix these things...
|
||||||
|
- Changed the [dei]syslog macros in tools.h to use a variable number of args,
|
||||||
|
thus making it safe to use them in nested 'if/else' statements.
|
||||||
|
- Fixed error handling in establishing an SVDRP connection (thanks to Davide
|
||||||
|
Achilli) for pointing this out).
|
||||||
|
5
config.c
5
config.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: config.c 1.78 2002/02/01 15:35:23 kls Exp $
|
* $Id: config.c 1.79 2002/02/02 12:45:30 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@ -296,9 +296,8 @@ bool cChannel::Switch(cDvbApi *DvbApi, bool Log)
|
|||||||
if (!DvbApi)
|
if (!DvbApi)
|
||||||
DvbApi = cDvbApi::PrimaryDvbApi;
|
DvbApi = cDvbApi::PrimaryDvbApi;
|
||||||
if (!DvbApi->Recording() && !groupSep) {
|
if (!DvbApi->Recording() && !groupSep) {
|
||||||
if (Log) {
|
if (Log)
|
||||||
isyslog(LOG_INFO, "switching to channel %d", number);
|
isyslog(LOG_INFO, "switching to channel %d", number);
|
||||||
}
|
|
||||||
for (int i = 3; i--;) {
|
for (int i = 3; i--;) {
|
||||||
switch (DvbApi->SetChannel(number, frequency, polarization, diseqc, srate, vpid, apid1, apid2, dpid1, dpid2, tpid, ca, pnr)) {
|
switch (DvbApi->SetChannel(number, frequency, polarization, diseqc, srate, vpid, apid1, apid2, dpid1, dpid2, tpid, ca, pnr)) {
|
||||||
case scrOk: return true;
|
case scrOk: return true;
|
||||||
|
17
dvbapi.c
17
dvbapi.c
@ -7,7 +7,7 @@
|
|||||||
* DVD support initially written by Andreas Schultz <aschultz@warp10.net>
|
* DVD support initially written by Andreas Schultz <aschultz@warp10.net>
|
||||||
* based on dvdplayer-0.5 by Matjaz Thaler <matjaz.thaler@guest.arnes.si>
|
* based on dvdplayer-0.5 by Matjaz Thaler <matjaz.thaler@guest.arnes.si>
|
||||||
*
|
*
|
||||||
* $Id: dvbapi.c 1.146 2002/01/26 15:39:48 kls Exp $
|
* $Id: dvbapi.c 1.147 2002/02/02 13:04:00 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//#define DVDDEBUG 1
|
//#define DVDDEBUG 1
|
||||||
@ -548,9 +548,8 @@ void cRecordBuffer::Input(void)
|
|||||||
}
|
}
|
||||||
else if (r < 0) {
|
else if (r < 0) {
|
||||||
if (FATALERRNO) {
|
if (FATALERRNO) {
|
||||||
if (errno == EBUFFEROVERFLOW) { // this error code is not defined in the library
|
if (errno == EBUFFEROVERFLOW) // this error code is not defined in the library
|
||||||
esyslog(LOG_ERR, "ERROR (%s,%d): DVB driver buffer overflow", __FILE__, __LINE__);
|
esyslog(LOG_ERR, "ERROR (%s,%d): DVB driver buffer overflow", __FILE__, __LINE__);
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
LOG_ERROR;
|
LOG_ERROR;
|
||||||
break;
|
break;
|
||||||
@ -1064,9 +1063,8 @@ cReplayBuffer::cReplayBuffer(cDvbApi *DvbApi, int VideoDev, int AudioDev, const
|
|||||||
return;
|
return;
|
||||||
// Create the index file:
|
// Create the index file:
|
||||||
index = new cIndexFile(FileName, false);
|
index = new cIndexFile(FileName, false);
|
||||||
if (!index) {
|
if (!index)
|
||||||
esyslog(LOG_ERR, "ERROR: can't allocate index");
|
esyslog(LOG_ERR, "ERROR: can't allocate index");
|
||||||
}
|
|
||||||
else if (!index->Ok()) {
|
else if (!index->Ok()) {
|
||||||
delete index;
|
delete index;
|
||||||
index = NULL;
|
index = NULL;
|
||||||
@ -2251,9 +2249,8 @@ void cTransferBuffer::Input(void)
|
|||||||
}
|
}
|
||||||
else if (r < 0) {
|
else if (r < 0) {
|
||||||
if (FATALERRNO) {
|
if (FATALERRNO) {
|
||||||
if (errno == EBUFFEROVERFLOW) { // this error code is not defined in the library
|
if (errno == EBUFFEROVERFLOW) // this error code is not defined in the library
|
||||||
esyslog(LOG_ERR, "ERROR (%s,%d): DVB driver buffer overflow", __FILE__, __LINE__);
|
esyslog(LOG_ERR, "ERROR (%s,%d): DVB driver buffer overflow", __FILE__, __LINE__);
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
LOG_ERROR;
|
LOG_ERROR;
|
||||||
break;
|
break;
|
||||||
@ -2719,12 +2716,10 @@ bool cDvbApi::Init(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
PrimaryDvbApi = dvbApi[0];
|
PrimaryDvbApi = dvbApi[0];
|
||||||
if (NumDvbApis > 0) {
|
if (NumDvbApis > 0)
|
||||||
isyslog(LOG_INFO, "found %d video device%s", NumDvbApis, NumDvbApis > 1 ? "s" : "");
|
isyslog(LOG_INFO, "found %d video device%s", NumDvbApis, NumDvbApis > 1 ? "s" : "");
|
||||||
} // need braces because of isyslog-macro
|
else
|
||||||
else {
|
|
||||||
esyslog(LOG_ERR, "ERROR: no video device found, giving up!");
|
esyslog(LOG_ERR, "ERROR: no video device found, giving up!");
|
||||||
}
|
|
||||||
return NumDvbApis > 0;
|
return NumDvbApis > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
5
remux.c
5
remux.c
@ -8,7 +8,7 @@
|
|||||||
* the Linux DVB driver's 'tuxplayer' example and were rewritten to suit
|
* the Linux DVB driver's 'tuxplayer' example and were rewritten to suit
|
||||||
* VDR's needs.
|
* VDR's needs.
|
||||||
*
|
*
|
||||||
* $Id: remux.c 1.6 2001/08/19 11:52:05 kls Exp $
|
* $Id: remux.c 1.7 2002/02/02 12:54:30 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* The calling interface of the 'cRemux::Process()' function is defined
|
/* The calling interface of the 'cRemux::Process()' function is defined
|
||||||
@ -583,9 +583,8 @@ XXX*/
|
|||||||
if (l < 0)
|
if (l < 0)
|
||||||
return NULL; // no useful data found, wait for more
|
return NULL; // no useful data found, wait for more
|
||||||
if (pt != NO_PICTURE) {
|
if (pt != NO_PICTURE) {
|
||||||
if (pt < I_FRAME || B_FRAME < pt) {
|
if (pt < I_FRAME || B_FRAME < pt)
|
||||||
esyslog(LOG_ERR, "ERROR: unknown picture type '%d'", pt);
|
esyslog(LOG_ERR, "ERROR: unknown picture type '%d'", pt);
|
||||||
}
|
|
||||||
else if (!synced) {
|
else if (!synced) {
|
||||||
if (pt == I_FRAME) {
|
if (pt == I_FRAME) {
|
||||||
resultDelivered = i; // will drop everything before this position
|
resultDelivered = i; // will drop everything before this position
|
||||||
|
4
svdrp.c
4
svdrp.c
@ -10,7 +10,7 @@
|
|||||||
* and interact with the Video Disk Recorder - or write a full featured
|
* and interact with the Video Disk Recorder - or write a full featured
|
||||||
* graphical interface that sits on top of an SVDRP connection.
|
* graphical interface that sits on top of an SVDRP connection.
|
||||||
*
|
*
|
||||||
* $Id: svdrp.c 1.28 2002/01/13 16:07:42 kls Exp $
|
* $Id: svdrp.c 1.29 2002/02/02 13:33:57 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "svdrp.h"
|
#include "svdrp.h"
|
||||||
@ -103,7 +103,7 @@ int cSocket::Accept(void)
|
|||||||
int newsock = accept(sock, (struct sockaddr *)&clientname, &size);
|
int newsock = accept(sock, (struct sockaddr *)&clientname, &size);
|
||||||
if (newsock > 0)
|
if (newsock > 0)
|
||||||
isyslog(LOG_INFO, "connect from %s, port %hd", inet_ntoa(clientname.sin_addr), ntohs(clientname.sin_port));
|
isyslog(LOG_INFO, "connect from %s, port %hd", inet_ntoa(clientname.sin_addr), ntohs(clientname.sin_port));
|
||||||
else if (errno != EINTR)
|
else if (errno != EINTR && errno != EAGAIN)
|
||||||
LOG_ERROR;
|
LOG_ERROR;
|
||||||
return newsock;
|
return newsock;
|
||||||
}
|
}
|
||||||
|
5
tools.c
5
tools.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: tools.c 1.53 2002/01/27 12:36:23 kls Exp $
|
* $Id: tools.c 1.54 2002/02/02 13:03:40 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "tools.h"
|
#include "tools.h"
|
||||||
@ -404,9 +404,8 @@ char *ReadLink(const char *FileName)
|
|||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
if (errno == ENOENT || errno == EINVAL) // file doesn't exist or is not a symlink
|
if (errno == ENOENT || errno == EINVAL) // file doesn't exist or is not a symlink
|
||||||
TargetName = FileName;
|
TargetName = FileName;
|
||||||
else { // some other error occurred
|
else // some other error occurred
|
||||||
LOG_ERROR_STR(FileName);
|
LOG_ERROR_STR(FileName);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (n < int(sizeof(RealName))) { // got it!
|
else if (n < int(sizeof(RealName))) { // got it!
|
||||||
RealName[n] = 0;
|
RealName[n] = 0;
|
||||||
|
8
tools.h
8
tools.h
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: tools.h 1.39 2002/01/26 15:38:10 kls Exp $
|
* $Id: tools.h 1.40 2002/02/02 13:16:47 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __TOOLS_H
|
#ifndef __TOOLS_H
|
||||||
@ -20,9 +20,9 @@
|
|||||||
|
|
||||||
extern int SysLogLevel;
|
extern int SysLogLevel;
|
||||||
|
|
||||||
#define esyslog if (SysLogLevel > 0) syslog
|
#define esyslog(a...) void( (SysLogLevel > 0) ? syslog(a) : void() )
|
||||||
#define isyslog if (SysLogLevel > 1) syslog
|
#define isyslog(a...) void( (SysLogLevel > 1) ? syslog(a) : void() )
|
||||||
#define dsyslog if (SysLogLevel > 2) syslog
|
#define dsyslog(a...) void( (SysLogLevel > 2) ? syslog(a) : void() )
|
||||||
|
|
||||||
#define LOG_ERROR esyslog(LOG_ERR, "ERROR (%s,%d): %m", __FILE__, __LINE__)
|
#define LOG_ERROR esyslog(LOG_ERR, "ERROR (%s,%d): %m", __FILE__, __LINE__)
|
||||||
#define LOG_ERROR_STR(s) esyslog(LOG_ERR, "ERROR: %s: %m", s)
|
#define LOG_ERROR_STR(s) esyslog(LOG_ERR, "ERROR: %s: %m", s)
|
||||||
|
Loading…
Reference in New Issue
Block a user