int ret = 0;
int const PATH_SIZE = MAX_CONF_VAL_LEN;
+ int opened = 0;
char *const actual_path = malloc(PATH_SIZE);
struct logger_priv_data *const lpd = malloc(sizeof *lpd);
goto failure;
}
- int opened = logger_open_buffer_from_config_get_path(log_id_by_name(name), conf, O_RDWR, &fdi->fd, actual_path, PATH_SIZE);
+ opened = logger_open_buffer_from_config_get_path(log_id_by_name(name), conf, O_RDWR, &fdi->fd, actual_path, PATH_SIZE);
if (opened <= 0) {
ret = opened ?: -EINVAL;
goto failure;
assert(fdis);
assert(conf);
+ int ret;
+ struct fd_info **fdi_ptrs;
+ unsigned int mask;
+ int fdi_cnt = 0;
+ int r;
+
if (enabled_buffers == 0)
return TIZEN_ERROR_INVALID_PARAMETER;
- int ret;
-
- struct fd_info **fdi_ptrs = calloc(bit_count(enabled_buffers) + 1 /* NULL terminator */, sizeof *fdi_ptrs);
+ fdi_ptrs = calloc(bit_count(enabled_buffers) + 1 /* NULL terminator */, sizeof *fdi_ptrs);
if (!fdi_ptrs)
return -ENOMEM;
__attribute__ ((cleanup(list_clear_free_contents))) list_head used_paths = NULL;
- unsigned int mask = ~0;
+ mask = ~0;
for (int i = 0; i < LOG_ID_MAX; ++i) {
mask &= ~(1u << i);
}
goto failure;
}
- int fdi_cnt = 0;
+ fdi_cnt = 0;
for (int i = 0; i < LOG_ID_MAX; ++i) {
if (!bit_test(enabled_buffers, i))
continue;
goto failure;
}
- int r = fdi->ops->create(fdi, conf, bufname, &used_paths);
+ r = fdi->ops->create(fdi, conf, bufname, &used_paths);
if (r < 0) {
// TODO: Inform about that again somewhere else
fdi_free(fdi);
char buf[BUF_LEN];
const int flags = O_CREAT | O_WRONLY | flag;
+ int r;
+ ssize_t s;
const int fd = open(filename, flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
if (fd < 0) {
return ret;
}
- int r;
if (limit == FILTER_ALLOW)
r = snprintf(buf, sizeof buf, "limiter|%s|%c=allow\n", tag, prio);
else if (limit == FILTER_DENY)
goto finish;
}
- const ssize_t s = write(fd, buf, r);
+ s = write(fd, buf, r);
if (s < 0) {
r = -errno;
perror("error writing config file");