prepare_ls_row);
if (ret < 0)
goto out;
- ret = opts->num_patterns? -E_NO_MATCH : 0;
if (!opts->num_matching_paths)
goto out;
ret = sort_matching_paths(opts);
afs_event(AUDIO_FILE_ADD, &msg, aft_row);
out:
if (ret < 0)
- ret = para_printf(&msg, "%s\n", para_strerror(-ret));
+ para_printf(&msg, "%s\n", para_strerror(-ret));
if (msg.offset)
pass_buffer_as_shm(msg.buf, msg.offset, &fd);
free(msg.buf);
struct osl_row *row, const char *name, void *data)
{
struct com_rm_action_data *crd = data;
- int ret, ret2;
+ int ret;
if (crd->flags & RM_FLAG_VERBOSE) {
ret = para_printf(&crd->pb, "removing %s\n", name);
afs_event(AUDIO_FILE_REMOVE, &crd->pb, row);
ret = osl_del_row(audio_file_table, row);
if (ret < 0)
- ret2 = para_printf(&crd->pb, "%s: %s\n", name,
- para_strerror(-ret));
+ para_printf(&crd->pb, "%s: %s\n", name, para_strerror(-ret));
else
crd->num_removed++;
return ret;
pmd.fnmatch_flags |= FNM_PATHNAME;
ret = for_each_matching_row(&pmd);
if (ret < 0) {
- ret = para_printf(&crd.pb, "%s\n", para_strerror(-ret));
+ para_printf(&crd.pb, "%s\n", para_strerror(-ret));
return;
}
if (!crd.num_removed && !(crd.flags & RM_FLAG_FORCE))
ret = for_each_matching_row(&pmd);
out:
if (ret < 0)
- ret = para_printf(&cad.pb, "%s\n", para_strerror(-ret));
+ para_printf(&cad.pb, "%s\n", para_strerror(-ret));
else if (cad.flags & CPSI_FLAG_VERBOSE) {
if (cad.num_copied)
- ret = para_printf(&cad.pb, "copied requested afsi from %s "
- "to %u files\n",
- source_path, cad.num_copied);
+ para_printf(&cad.pb, "copied requested afsi from %s "
+ "to %u files\n", source_path, cad.num_copied);
else
- ret = para_printf(&cad.pb, "nothing copied\n");
+ para_printf(&cad.pb, "nothing copied\n");
}
if (cad.pb.offset)
pass_buffer_as_shm(cad.pb.buf, cad.pb.offset, &fd);
{
struct lsatt_action_data *laad = data;
struct osl_object bitnum_obj;
- int ret, ret2;
+ int ret;
if (!(laad->flags & LSATT_FLAG_LONG))
return para_printf(&laad->pb, "%s\n", name);
ret = osl_get_object(table, row, ATTCOL_BITNUM, &bitnum_obj);
if (ret < 0) {
- ret2 = para_printf(&laad->pb, "%s: %s\n", name, para_strerror(-ret));
+ para_printf(&laad->pb, "%s: %s\n", name, para_strerror(-ret));
return ret;
}
return para_printf(&laad->pb, "%u\t%s\n", *(unsigned char*)bitnum_obj.data,
static void com_addatt_callback(int fd, const struct osl_object *query)
{
- char *p = query->data;
+ char *p;
int ret = 1, ret2 = 0;
struct para_buffer pb = {
.max_size = SHMMAX,
}
out:
if (ret < 0 && ret2 >= 0)
- ret = para_printf(&pb, "%s: %s\n", p, para_strerror(-ret));
+ para_printf(&pb, "%s: %s\n", p, para_strerror(-ret));
if (pb.offset)
pass_buffer_as_shm(pb.buf, pb.offset, &fd);
free(pb.buf);
ret = osl_update_object(attribute_table, row, ATTCOL_NAME, &obj);
out:
if (ret < 0)
- ret = para_printf(&pb, "%s\n", para_strerror(-ret));
+ para_printf(&pb, "%s\n", para_strerror(-ret));
else
afs_event(ATTRIBUTE_RENAME, &pb, NULL);
if (pb.offset)
ret = check_perms(uid);
if (ret < 0)
goto out;
- ret = -E_INVALID_AUDIOD_CMD;
cmd = para_strdup(buf);
p = strchr(cmd, '\n');
if (!p)
struct lsblob_action_data *lbad = data;
struct osl_object obj;
uint32_t id;
- int ret, ret2;
+ int ret;
if (!(lbad->flags & BLOB_LS_FLAG_LONG))
return para_printf(&lbad->pb, "%s\n", name);
ret = osl_get_object(table, row, BLOBCOL_ID, &obj);
if (ret < 0) {
- ret2 = para_printf(&lbad->pb, "%s: %s\n", name, para_strerror(-ret));
+ para_printf(&lbad->pb, "%s: %s\n", name, para_strerror(-ret));
return ret;
}
id = *(uint32_t *)obj.data;
pmd.loop_col_num = BLOBCOL_ID;
ret = for_each_matching_row(&pmd);
if (ret < 0)
- ret = para_printf(&lbad.pb, "%s\n", para_strerror(-ret));
+ para_printf(&lbad.pb, "%s\n", para_strerror(-ret));
if (lbad.pb.offset)
pass_buffer_as_shm(lbad.pb.buf, lbad.pb.offset, &fd);
free(lbad.pb.buf);
const char *name, void *data)
{
struct rmblob_data *rmbd = data;
- int ret = osl_del_row(table, row), ret2;
+ int ret = osl_del_row(table, row);
if (ret < 0) {
- ret2 = para_printf(&rmbd->pb, "%s: %s\n", name, para_strerror(-ret));
+ para_printf(&rmbd->pb, "%s: %s\n", name, para_strerror(-ret));
return ret;
}
rmbd->num_removed++;
}
}
if (bg >= 0) {
- if (sep++)
+ if (sep)
*dst++ = ';';
if (bg < 8) {
*dst++ = '4';
*/
int para_exec_cmdline_pid(pid_t *pid, const char *cmdline, int *fds)
{
- int argc, ret;
+ int ret;
char **argv;
char *tmp = para_strdup(cmdline);
- argc = split_args(tmp, &argv, " \t");
+ split_args(tmp, &argv, " \t");
ret = para_exec(pid, argv[0], argv, fds);
free(argv);
free(tmp);
{
unsigned lines;
int fvr = first_visible_rbe(&lines);
+
if (fvr < 0 || fvr + 1 >= ringbuffer_filled(bot_win_rb)) {
print_in_bar(COLOR_ERRMSG, "top of buffer is shown\n");
return;
}
scroll_position = fvr + 1;
for (; scroll_position > 0; scroll_position--) {
- fvr = first_visible_rbe(&lines);
+ first_visible_rbe(&lines);
if (lines == bot.lines)
break;
}
struct osl_object mood_def;
struct mood_line_parser_data mlpd = {.line_num = 0};
- int ret2, ret = mood_get_name_and_def_by_row(mood_row, &mood_name, &mood_def);
+ int ret = mood_get_name_and_def_by_row(mood_row, &mood_name, &mood_def);
if (ret < 0) {
- ret2 = para_printf(pb, "failed to get mood definition: %s\n",
+ para_printf(pb, "failed to get mood definition: %s\n",
para_strerror(-ret));
return ret;
}
ret = for_each_line_ro(mood_def.data, mood_def.size,
parse_mood_line, &mlpd);
if (ret < 0)
- ret2 = para_printf(pb, "%s line %u: %s\n", mood_name, mlpd.line_num,
+ para_printf(pb, "%s line %u: %s\n", mood_name, mlpd.line_num,
para_strerror(-ret));
out:
osl_close_disk_object(&mood_def);
long unsigned num_chunks;
ogg_int64_t max = 0, min = 0, old_pos = 0;
- ret = 0;
num = time_total / chunk_time + 3;
PARA_DEBUG_LOG("chunk time: %g allocating %d chunk pointers\n",
chunk_time, num);
int i, j, ret;
const struct osl_column_description *cd;
- ret = -E_BAD_TABLE_DESC;
ret = verify_name(t->desc->name);
if (ret < 0)
goto err;
*
* \return The number of substrings found in \a args.
*/
-__must_check unsigned split_args(char *args, char *** const argv_ptr, const char *delim)
+unsigned split_args(char *args, char *** const argv_ptr, const char *delim)
{
- char *p = args;
+ char *p;
char **argv;
size_t n = 0, i, j;
__must_check __malloc char *para_tmpname(void);
__must_check __malloc char *para_logname(void);
__must_check __malloc char *para_homedir(void);
-__must_check unsigned split_args(char *args, char *** const argv_ptr, const char *delim);
+unsigned split_args(char *args, char *** const argv_ptr, const char *delim);
__malloc char *para_hostname(void);
__printf_2_3 int para_printf(struct para_buffer *b, const char *fmt, ...);
/** Used for for_each_line() and for_each_line_ro(). */
} else if (FD_ISSET(vsst->afs_socket, &s->wfds)) {
PARA_NOTICE_LOG("requesting new fd from afs\n");
ret = send_buffer(vsst->afs_socket, "new");
- vsst->afsss = AFS_SOCKET_AFD_PENDING;
+ if (ret < 0)
+ PARA_CRIT_LOG("%s\n", para_strerror(-ret));
+ else
+ vsst->afsss = AFS_SOCKET_AFD_PENDING;
}
for (i = 0; senders[i].name; i++) {
if (!senders[i].post_select)