From 85ec8f30f6bef37a9a3bc2b84314654648f2f81c Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 7 Sep 2018 12:44:08 +0200 Subject: [PATCH] aft: Change return type of make_status_items() to void. All callers ignore the return value anyway. However, let's print a warning in the failure case. --- aft.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aft.c b/aft.c index 0544091b..b6ea0257 100644 --- a/aft.c +++ b/aft.c @@ -994,7 +994,7 @@ void free_status_items(void) freep(&parser_friendly_status_items); } -static int make_status_items(void) +static void make_status_items(void) { const struct lls_command *cmd = SERVER_CMD_CMD_PTR(LS); char *argv[] = {"ls", "--admissible", "--listing-mode=verbose"}; @@ -1005,7 +1005,7 @@ static int make_status_items(void) free_status_items(); if (!status_item_ls_data.path) /* no audio file open */ - return 0; + return; ret = lls_parse(ARRAY_SIZE(argv), argv, cmd, &opts.lpr, NULL); assert(ret >= 0); time(¤t_time); @@ -1025,10 +1025,12 @@ static int make_status_items(void) parser_friendly_status_items = pb.buf; ret = 1; out: - if (ret < 0) + if (ret < 0) { + PARA_WARNING_LOG("could not create status items: %s\n", + para_strerror(-ret)); free_status_items(); + } lls_free_parse_result(opts.lpr, cmd); - return ret; } /** -- 2.39.5