Correct mistake which stops unix sockets being created where directories do not yet exist.
This commit is contained in:
parent
afbaf935d6
commit
79bbe2e44d
3 changed files with 8 additions and 3 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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__ */
|
||||
|
|
Loading…
Add table
Reference in a new issue