diff --git a/src/epggrab/module.c b/src/epggrab/module.c index 4f32ef72..d66d2643 100644 --- a/src/epggrab/module.c +++ b/src/epggrab/module.c @@ -361,6 +361,7 @@ int epggrab_module_enable_socket ( void *m, uint8_t e ) /* Enable */ } else { unlink(mod->path); // just in case! + hts_settings_makedirs(mod->path); mod->sock = socket(AF_UNIX, SOCK_STREAM, 0); assert(mod->sock); diff --git a/src/settings.c b/src/settings.c index 8f2088dc..eb33d5f2 100644 --- a/src/settings.c +++ b/src/settings.c @@ -80,12 +80,14 @@ hts_settings_init(const char *confpath) /** * */ -static int -hts_settings_makedirs ( char *path ) +int +hts_settings_makedirs ( const char *inpath ) { size_t x; struct stat st; - size_t l = strlen(path); + char path[512]; + size_t l = strlen(inpath); + strcpy(path, inpath); for(x = 0; x < l; x++) { if(path[x] == '/' && x != 0) { path[x] = 0; diff --git a/src/settings.h b/src/settings.h index 1713d9d2..7f0bb8d0 100644 --- a/src/settings.h +++ b/src/settings.h @@ -34,4 +34,6 @@ const char *hts_settings_get_root(void); int hts_settings_open_file(int for_write, const char *pathfmt, ...); +int hts_settings_makedirs ( const char *path ); + #endif /* HTSSETTINGS_H__ */