access_t *aa;
uint32_t rec_count, net_count;
int c1, c2;
+ struct stat st;
assert(de->de_s == NULL);
assert(de->de_chain == NULL);
}
access_destroy(aa);
+ 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);
+ return -EIO;
+ }
+
pro = de->de_config->dvr_profile;
prch = malloc(sizeof(*prch));
profile_chain_init(prch, pro, de->de_channel);
}
}
- if(stat(path, &st) == -1) {
+ if (stat(path, &st) == -1) {
tvhdebug(LS_DVR, "File \"%s\" -- %s -- Using for recording",
path, strerror(errno));
break;
htsmsg_t *info, *e;
htsmsg_field_t *f;
muxer_t *muxer;
+ struct stat st;
int i;
if (!cfg) {
return -1;
}
+ if (stat(cfg->dvr_storage, &st) || !S_ISDIR(st.st_mode)) {
+ dvr_rec_fatal_error(de, "Unable to create file in directory '%s", cfg->dvr_storage);
+ return -1;
+ }
+
if (!dvr_vfs_rec_start_check(cfg)) {
dvr_rec_fatal_error(de, "Not enough free disk space");
return SM_CODE_NO_SPACE;