diff options
author | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-11-01 22:39:12 (EST) |
---|---|---|
committer | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-11-01 22:39:12 (EST) |
commit | 908c671d6b3807854d41b4b51c584d16d7c2694b (patch) | |
tree | c3f120f1bfb0fed4a7a80b0759233e2cf38d3a38 /libopkg/opkg_cmd.c | |
parent | 5c617e296570ed33196988e96481a4ef3e6e626e (diff) |
Cleanup error_list stuff a bit more.
- Remove reverse_error_list.
- Push messages on to the tail of the list.
- Move the print function in with the other error list functions.
- Indentation and variable name cleanups.
git-svn-id: http://opkg.googlecode.com/svn/trunk@238 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/opkg_cmd.c')
-rw-r--r-- | libopkg/opkg_cmd.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c index e7038c5..99ee64d 100644 --- a/libopkg/opkg_cmd.c +++ b/libopkg/opkg_cmd.c @@ -141,26 +141,6 @@ opkg_cmd_t *opkg_cmd_find(const char *name) return NULL; } -void opkg_print_error_list (opkg_conf_t *conf) -{ - struct errlist *err = error_list; - - if (err) { - reverse_error_list(&err); - - printf ("Collected errors:\n"); - /* Here we print the errors collected and free the list */ - while (err != NULL) { - printf (" * %s", err->errmsg); - err = err->next; - - } - - free_error_list(&error_list); - } - -} - int opkg_cmd_exec(opkg_cmd_t *cmd, opkg_conf_t *conf, int argc, const char **argv, void *userdata) { int result; @@ -169,11 +149,8 @@ int opkg_cmd_exec(opkg_cmd_t *cmd, opkg_conf_t *conf, int argc, const char **arg result = (cmd->fun)(conf, argc, argv); - if ( result != 0 && !error_list) { - opkg_message(conf, OPKG_NOTICE, "An error occurred, return value: %d.\n", result); - } - - opkg_print_error_list (conf); + print_error_list(); + free_error_list(); p_userdata = NULL; return result; |