diff options
author | Xavier Chantry <chantry.xavier@gmail.com> | 2011-01-30 13:09:11 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-01-31 09:36:30 -0600 |
commit | ed1aef7bc5caac95358c4827f162a845230051a2 (patch) | |
tree | 8aac602bfd509b6f0509aa5fbe9e8211cff2ebb1 | |
parent | 2e1b5c96a639e4196c018dff0ad05ba0027f303c (diff) | |
download | pacman-ed1aef7bc5caac95358c4827f162a845230051a2.tar.xz |
libalpm: fix db_update documentation
return codes were mixed up
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | lib/libalpm/be_sync.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 8c67bb19..bc17f1b9 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -51,19 +51,20 @@ * * Example: * @code - * pmdb_t *db; - * int result; - * db = alpm_list_getdata(alpm_option_get_syncdbs()); + * alpm_list_t *syncs = alpm_option_get_syncdbs(); * if(alpm_trans_init(0, NULL, NULL, NULL) == 0) { - * result = alpm_db_update(0, db); - * alpm_trans_release(); + * for(i = syncs; i; i = alpm_list_next(i)) { + * pmdb_t *db = alpm_list_getdata(i); + * result = alpm_db_update(0, db); + * alpm_trans_release(); * - * if(result > 0) { - * printf("Unable to update database: %s\n", alpm_strerrorlast()); - * } else if(result < 0) { - * printf("Database already up to date\n"); - * } else { - * printf("Database updated\n"); + * if(result < 0) { + * printf("Unable to update database: %s\n", alpm_strerrorlast()); + * } else if(result == 1) { + * printf("Database already up to date\n"); + * } else { + * printf("Database updated\n"); + * } * } * } * @endcode @@ -74,7 +75,7 @@ * @param force if true, then forces the update, otherwise update only in case * the database isn't up to date * @param db pointer to the package database to update - * @return 0 on success, > 0 on error (pm_errno is set accordingly), < 0 if up + * @return 0 on success, -1 on error (pm_errno is set accordingly), 1 if up to * to date */ int SYMEXPORT alpm_db_update(int force, pmdb_t *db) |