diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2006-08-13 08:58:50 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2006-08-13 08:58:50 +0200 |
commit | dc32738b27b2cce5a10398c96a1d78078b32a141 (patch) | |
tree | def434713c11a100b03c9b6725c493abc0b1872f /plugin.c | |
parent | 1c3acf28af363bbaba73513ccf298dd0ecb088f6 (diff) | |
download | vdr-dc32738b27b2cce5a10398c96a1d78078b32a141.tar.gz vdr-dc32738b27b2cce5a10398c96a1d78078b32a141.tar.bz2 |
Added a log error message to cPlugin::ConfigDirectory() in case a plugin calls it from a separate thread1.4.1-4
Diffstat (limited to 'plugin.c')
-rw-r--r-- | plugin.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: plugin.c 1.22 2006/04/17 09:20:05 kls Exp $ + * $Id: plugin.c 1.23 2006/08/13 08:51:44 kls Exp $ */ #include "plugin.h" @@ -15,6 +15,7 @@ #include <time.h> #include "config.h" #include "interface.h" +#include "thread.h" #define LIBVDR_PREFIX "libvdr-" #define SO_INDICATOR ".so." @@ -137,6 +138,8 @@ void cPlugin::SetConfigDirectory(const char *Dir) const char *cPlugin::ConfigDirectory(const char *PluginName) { static char *buffer = NULL; + if (!cThread::IsMainThread()) + esyslog("ERROR: plugin '%s' called cPlugin::ConfigDirectory(), which is not thread safe!", PluginName ? PluginName : "<no name given>"); free(buffer); asprintf(&buffer, "%s/plugins%s%s", configDirectory, PluginName ? "/" : "", PluginName ? PluginName : ""); return MakeDirs(buffer, true) ? buffer : NULL; |