aft: Change return type of make_status_items() to void.
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 7 Sep 2018 10:44:08 +0000 (12:44 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 19 Sep 2018 18:42:39 +0000 (20:42 +0200)
All callers ignore the return value anyway. However, let's print a
warning in the failure case.

aft.c

diff --git a/aft.c b/aft.c
index 0544091..b6ea025 100644 (file)
--- 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(&current_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;
 }
 
 /**