From 27acdc2c94de558103eb29260c179a49c9b05c14 Mon Sep 17 00:00:00 2001 From: Stefano Esposito Date: Sat, 8 Sep 2007 18:41:45 +0200 Subject: make alpm_strerror binding friendly I'm currently working on python bindings for alpm written in pyrex. While working i found that declaring alpm_strerror as char * alpm_strerror (void) instead of char * alpm_strerror (int err) and then using pm_errno in the implementation instead of err, could make it more bindings-friendly. Dan: cleaned up and added void to declaration. Instead of replacing existing function, add a new function called 'alpm_strerrorlast(void)'. Signed-off-by: Stefano Esposito Signed-off-by: Dan McGee --- src/util/testpkg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/util/testpkg.c') diff --git a/src/util/testpkg.c b/src/util/testpkg.c index 71993bdc..7da18ca6 100644 --- a/src/util/testpkg.c +++ b/src/util/testpkg.c @@ -50,7 +50,7 @@ int main(int argc, char **argv) } if(alpm_initialize() == -1) { - fprintf(stderr, "cannot initilize alpm: %s\n", alpm_strerror(pm_errno)); + fprintf(stderr, "cannot initilize alpm: %s\n", alpm_strerrorlast()); return(1); } @@ -65,7 +65,7 @@ int main(int argc, char **argv) } if(alpm_release() == -1) { - fprintf(stderr, "error releasing alpm: %s\n", alpm_strerror(pm_errno)); + fprintf(stderr, "error releasing alpm: %s\n", alpm_strerrorlast()); } return(retval); -- cgit v1.2.3