diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-07-22 14:56:27 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-07-22 14:56:27 +0300 |
commit | 93f0b3524c1263b99a1a4bf718c27e6ad7b6aea8 (patch) | |
tree | 84261f2a088ff9bf53a6db30669602f159a01b00 /src/apk.c | |
parent | 0a7991f70dcfe9f8e05f6a4a4a59af21be878915 (diff) | |
download | apk-tools-93f0b3524c1263b99a1a4bf718c27e6ad7b6aea8.tar.gz apk-tools-93f0b3524c1263b99a1a4bf718c27e6ad7b6aea8.tar.bz2 apk-tools-93f0b3524c1263b99a1a4bf718c27e6ad7b6aea8.tar.xz apk-tools-93f0b3524c1263b99a1a4bf718c27e6ad7b6aea8.zip |
various: more informative error messages
Diffstat (limited to 'src/apk.c')
-rw-r--r-- | src/apk.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -50,6 +50,24 @@ static struct apk_option generic_options[] = { required_argument, "TIME" }, }; +const char *apk_error_str(int error) +{ + if (error < 0) + error = -error; + switch (error) { + case ENOKEY: + return "UNTRUSTED signature"; + case EKEYREJECTED: + return "BAD signature"; + case EIO: + return "IO ERROR"; + case EBADMSG: + return "BAD archive"; + default: + return strerror(error); + } +} + void apk_log(const char *prefix, const char *format, ...) { va_list va; |