]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Correct mistake which stops unix sockets being created where directories do not yet...
authorAdam Sutton <dev@adamsutton.me.uk>
Fri, 17 Aug 2012 12:46:02 +0000 (13:46 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Fri, 17 Aug 2012 12:46:02 +0000 (13:46 +0100)
src/epggrab/module.c
src/settings.c
src/settings.h

index 4f32ef72d0d3bfb15cfca1f5c1c7816de5e57499..d66d264378c47034f9029d803e62c172dd44874e 100644 (file)
@@ -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);
index 8f2088dc636e258df3f8b014299525761eecb4b7..eb33d5f296e0ce73bdb0e61744a8e647d436bd8a 100644 (file)
@@ -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;
index 1713d9d268eba298d741362b63ec0c29cf48d265..7f0bb8d025811072d6e2cda8a1d98ed18bce5f78 100644 (file)
@@ -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__ */