htsmsg_add_str(svc, "svcname", str);
if ((str = htsmsg_get_str(e, "provider")))
htsmsg_add_str(svc, "provider", str);
- if (!(htsmsg_get_u32(e, "type", &u32)))
+ if (!(htsmsg_get_u32(e, "type", &u32)))
htsmsg_add_u32(svc, "dvb_servicetype", u32);
if (!htsmsg_get_u32(e, "channel", &u32))
htsmsg_add_u32(svc, "lcn", u32);
htsmsg_add_u32(svc, "enabled", u32 ? 0 : 1);
if ((str = htsmsg_get_str(e, "charset")))
htsmsg_add_str(svc, "charset", str);
- if ((str = htsmsg_get_str(e, "default_authority")))
+ if ((str = htsmsg_get_str(e, "default_authority")))
htsmsg_add_str(svc, "cridauth", str);
-
+
// TODO: dvb_eit_enable
hts_settings_save(svc, "input/linuxdvb/networks/%s/muxes/%s/services/%s",
"fec_lo",
"fec"
};
-
+
/* Load the adapter config */
if (!(tun = hts_settings_load("dvbadapters/%s", name))) return;
htsmsg_t *c, *e, *m;
htsmsg_field_t *f;
const char *str;
-
+
if ((c = hts_settings_load_r(1, path))) {
HTSMSG_FOREACH(f, c) {
if (!(e = htsmsg_field_get_map(f))) continue;
htsmsg_field_t *f, *f2;
const char *str;
uint32_t u32;
-
+
if ((c = hts_settings_load_r(1, path))) {
HTSMSG_FOREACH(f, c) {
if (!(e = htsmsg_field_get_map(f))) continue;
/* Update EPG grabbers */
hts_settings_remove("epggrab/otamux");
config_migrate_v1_epggrab("epggrab/xmltv/channels", channels);
-
+
/* Save the channels */
// Note: UUID will be stored in the file (redundant) but that's no biggy
HTSMSG_FOREACH(f, channels) {
/* Do we have IPTV config to migrate ? */
if (hts_settings_exists("input/iptv/muxes")) {
-
+
/* Create a dummy network */
uuid_set(&u, NULL);
uuid_get_hex(&u, ubuf);
}
if (chdir(cwd)) {
- tvherror(LS_CONFIG, "unable to change directory to '%s'", cwd);
+ tvherror(LS_CONFIG, "unable to change directory to '%s': %s", cwd, strerror(errno));
goto fatal;
}
return;
tvh_str_set(&config.realm, "tvheadend");
tvh_str_set(&config.http_server_name, "HTS/tvheadend");
idnode_changed(&config.idnode);
-
+
/* Perform migrations */
} else {
if (config_migrate(backup))
uint32_t rec_count, net_count;
int ret = 0, pri, c1, c2;
struct stat st;
+ int stat_ret;
assert(de->de_s == NULL);
assert(de->de_chain == NULL);
}
}
- if(stat(de->de_config->dvr_storage, &st) || !S_ISDIR(st.st_mode)) {
- tvherror(LS_DVR, "the directory '%s' is not accessible", de->de_config->dvr_storage);
+ stat_ret = stat(de->de_config->dvr_storage, &st);
+
+ //If the stat() failed, show the error message.
+ if(stat_ret != 0) {
+ tvherror(LS_DVR, "Directory '%s' not accessible: %s", de->de_config->dvr_storage, strerror(errno));
+ ret = -EIO;
+ goto _return;
+ }
+
+ //If the stat() worked, but the path is not a directory.
+ if(!S_ISDIR(st.st_mode) && stat_ret == 0) {
+ tvherror(LS_DVR, "'%s' is not a directory.", de->de_config->dvr_storage);
ret = -EIO;
goto _return;
}