struct stat st;
uint32_t u32;
dvr_config_t *cfg;
-
+
dvr_iov_max = sysconf(_SC_IOV_MAX);
/* Default settings */
htsmsg_get_u32(m, "retention-days", &cfg->dvr_retention_days);
tvh_str_set(&cfg->dvr_storage, htsmsg_get_str(m, "storage"));
-// Convert 0xxx format permission strings to integer for internal use
-// Note no checking that strtol won't overflow int - this should never happen with three-digit numbers
+/*
+ * Convert 0xxx format permission strings to integer for internal use
+ * Note no checking that strtol won't overflow int - this should never happen with three-digit numbers
+ */
if ((s = htsmsg_get_str(m, "file-permissions")))
cfg->dvr_muxcnf.m_file_permissions = (int)strtol(s,NULL,0);
htsmsg_add_str(m, "config_name", cfg->dvr_config_name);
htsmsg_add_str(m, "storage", cfg->dvr_storage);
-// Convert permissions to 0xxx octal format and output
+/* Convert permissions to 0xxx octal format and output */
snprintf(buffer,sizeof(buffer),"%04o",cfg->dvr_muxcnf.m_file_permissions);
htsmsg_add_str(m, "file-permissions", buffer);
typedef struct muxer_config {
int m_flags;
muxer_cache_type_t m_cache;
-// directory_permissions should really be in dvr.h as it's not really needed for the muxer
-// but it's kept with file_permissions for neatness
+
+/*
+ * directory_permissions should really be in dvr.h as it's not really needed for the muxer
+ * but it's kept with file_permissions for neatness
+ */
+
int m_file_permissions;
int m_directory_permissions;
} muxer_config_t;
int fd;
pass_muxer_t *pm = (pass_muxer_t*)m;
- tvhlog(LOG_DEBUG, "pass", "Creating file \"%s\" with file permissions \"%o\"", filename, pm->m_config.m_file_permissions);
+ tvhtrace("pass", "Creating file \"%s\" with file permissions \"%o\"", filename, pm->m_config.m_file_permissions);
fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, pm->m_config.m_file_permissions);
{
int fd;
- tvhlog(LOG_DEBUG, "mkv", "Creating file \"%s\" with file permissions \"%o\"", filename, permissions);
+ tvhtrace("mkv", "Creating file \"%s\" with file permissions \"%o\"", filename, permissions);
fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, permissions);
path[x] = 0;
if (stat(path, &st)) {
err = mkdir(path, mode);
- tvhlog(LOG_DEBUG, "settings", "Creating directory \"%s\" with octal permissions \"%o\"", path, mode);
+ tvhtrace("settings", "Creating directory \"%s\" with octal permissions \"%o\"", path, mode);
} else {
err = S_ISDIR(st.st_mode) ? 0 : 1;
errno = ENOTDIR;
htsmsg_add_str(r, "storage", cfg->dvr_storage);
htsmsg_add_str(r, "container", muxer_container_type2txt(cfg->dvr_mc));
-// Convert integer permissions to an octal-format 0xxx string and store it in the config file
+/* Convert integer permissions to an octal-format 0xxx string and store it in the config file */
snprintf(buffer,sizeof(buffer),"%04o",cfg->dvr_muxcnf.m_file_permissions);
htsmsg_add_str(r, "filePermissions", buffer);
if((s = http_arg_get(&hc->hc_req_args, "container")) != NULL)
dvr_container_set(cfg,s);
-// Convert 0xxx format permission strings to integer for internal use
-// Note no checking that strtol won't overflow int - this should never happen with three-digit numbers
+/*
+ * Convert 0xxx format permission strings to integer for internal use
+ * Note no checking that strtol won't overflow int - this should never happen with three-digit numbers
+ */
if((s = http_arg_get(&hc->hc_req_args, "filePermissions")) != NULL)
dvr_file_permissions_set(cfg,(int)strtol(s,NULL,0));