diff --git a/bin/xbps-pkgdb/check.c b/bin/xbps-pkgdb/check.c index f2918799..f5dcf9da 100644 --- a/bin/xbps-pkgdb/check.c +++ b/bin/xbps-pkgdb/check.c @@ -100,7 +100,7 @@ check_pkg_integrity(struct xbps_handle *xhp, xbps_error_printf("%s: cannot read %s, ignoring...\n", pkgname, buf); free(buf); - return -1; + return -ENOENT; } rv = xbps_file_sha256_check(buf, sha256); free(buf); @@ -112,7 +112,7 @@ check_pkg_integrity(struct xbps_handle *xhp, xbps_object_release(filesd); xbps_error_printf("%s: metadata file has been " "modified!\n", pkgname); - return 1; + return -rv; } } @@ -135,5 +135,5 @@ do { \ #undef RUN_PKG_CHECK - return errors ? EXIT_FAILURE : EXIT_SUCCESS; + return errors; } diff --git a/bin/xbps-pkgdb/main.c b/bin/xbps-pkgdb/main.c index d1a5649c..48751e98 100644 --- a/bin/xbps-pkgdb/main.c +++ b/bin/xbps-pkgdb/main.c @@ -183,9 +183,9 @@ main(int argc, char **argv) } else { for (i = optind; i < argc; i++) { rv = check_pkg_integrity(&xh, NULL, argv[i]); - if (rv != 0) + if (rv < 0) xbps_error_printf("Failed to check " - "`%s': %s\n", argv[i], strerror(rv)); + "`%s': %s\n", argv[i], strerror(-rv)); } }