#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <ctype.h>
#include <signal.h>
#include <errno.h>
#include <time.h>
#include <syslog.h>
#include <grp.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
#include <sys/param.h>
#include <sys/wait.h>
#include <unistd.h>
#include <pwd.h>
Go to the source code of this file.
|
#define | _GNU_SOURCE |
|
#define | PIDFILE "/var/run/vdr.pid" |
|
#define | VDRBIN "/usr/bin/vdr" |
|
#define | errmsg(reason, ...) |
|
#define | errno_msg(reason, ...) |
|
#define | _errno_msg(reason, ...) |
|
#define | errno_log(reason, ...) |
|
#define | _errno_log(reason, ...) |
|
#define | errexit(fn, reason, ...) do { if ((fn) == -1) { errno_msg (reason, ## __VA_ARGS__); } } while (0) |
|
#define | _errexit(fn, reason, ...) do { if ((fn) == -1) { _errno_msg (reason, ## __VA_ARGS__); } } while (0) |
|
#define | BASEMOD (budget ? mod_budget : mod_dvb) |
|
#define | NUM_STOPTIMES 5 |
|
#define _errexit |
( |
|
fn, |
|
|
|
reason, |
|
|
|
... |
|
) |
| do { if ((fn) == -1) { _errno_msg (reason, ## __VA_ARGS__); } } while (0) |
#define _errno_log |
( |
|
reason, |
|
|
|
... |
|
) |
| |
Value:do { \
int err = errno; \
fprintf (stderr,
"%s: " reason
": %s\n",
progname, ## __VA_ARGS__, strerror (err)); \
syslog (LOG_ERR, reason ": %s", ## __VA_ARGS__, strerror (err)); \
_exit (2); \
} while (0)
static const char * progname
Definition at line 77 of file runvdr.c.
Referenced by main().
#define _errno_msg |
( |
|
reason, |
|
|
|
... |
|
) |
| |
Value:do { \
fprintf (stderr,
"%s: " reason
": %s\n",
progname, ## __VA_ARGS__, strerror (errno)); \
_exit (2); \
} while (0)
static const char * progname
Definition at line 63 of file runvdr.c.
Referenced by scan_plugins().
#define errexit |
( |
|
fn, |
|
|
|
reason, |
|
|
|
... |
|
) |
| do { if ((fn) == -1) { errno_msg (reason, ## __VA_ARGS__); } } while (0) |
#define errmsg |
( |
|
reason, |
|
|
|
... |
|
) |
| |
#define errno_log |
( |
|
reason, |
|
|
|
... |
|
) |
| |
Value:do { \
int err = errno; \
fprintf (stderr,
"%s: " reason
": %s\n",
progname, ## __VA_ARGS__, strerror (err)); \
syslog (LOG_ERR, reason ": %s", ## __VA_ARGS__, strerror (err)); \
exit (2); \
} while (0)
static const char * progname
Definition at line 69 of file runvdr.c.
Referenced by main().
#define errno_msg |
( |
|
reason, |
|
|
|
... |
|
) |
| |
#define PIDFILE "/var/run/vdr.pid" |
#define VDRBIN "/usr/bin/vdr" |
static int dowait |
( |
int |
which | ) |
|
|
static |
static const char* getenv_default |
( |
const char * |
var, |
|
|
const char * |
dflt |
|
) |
| |
|
static |
static void list_append |
( |
List * |
list, |
|
|
const char * |
item |
|
) |
| |
|
static |
static size_t list_find |
( |
List * |
list, |
|
|
const char * |
cmp |
|
) |
| |
|
static |
static void list_free |
( |
List * |
list | ) |
|
|
static |
static void list_remove |
( |
List * |
list, |
|
|
size_t |
index |
|
) |
| |
|
static |
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 550 of file runvdr.c.
References _errno_log, dowait(), errexit, errmsg, errno_log, errno_msg, List::items, list_append(), list_free(), NUM_STOPTIMES, parse_modules_24(), parse_modules_26(), pidfile_remove(), pidfile_write(), progname, scan_plugins(), sig_default(), sig_propagate(), sig_quit(), stoptimecount, stoptimes, usr1, vdr, and VDRBIN.
static char* parse_modules_24 |
( |
char * |
line, |
|
|
int |
budget |
|
) |
| |
|
static |
static char* parse_modules_26 |
( |
char * |
line, |
|
|
int |
budget |
|
) |
| |
|
static |
static void pidfile_remove |
( |
void |
| ) |
|
|
static |
static void pidfile_write |
( |
void |
| ) |
|
|
static |
static void scan_plugins |
( |
List * |
args | ) |
|
|
static |
Definition at line 281 of file runvdr.c.
References _errexit, _errno_msg, dowait(), errexit, errmsg, errno_msg, getenv_default(), List::items, List::length, list_append(), list_find(), list_free(), list_remove(), and VERSION.
Referenced by main().
static void sig_default |
( |
int |
sig | ) |
|
|
static |
static void sig_propagate |
( |
int |
sig | ) |
|
|
static |
static void sig_quit |
( |
int |
sig | ) |
|
|
static |
const char mod_budget[] = "budget-core\0\0" |
|
static |
const char mod_dvb[] = "dvb-core\0\0" |
|
static |