diff --git a/bin/xbps-repo/clean.c b/bin/xbps-repo/clean.c index c0c849dc..5d267b32 100644 --- a/bin/xbps-repo/clean.c +++ b/bin/xbps-repo/clean.c @@ -80,13 +80,18 @@ cachedir_clean(struct xbps_handle *xhp) if (xbps_file_hash_check(binpkg, rsha256) == ERANGE) { printf("Removed %s from cachedir (sha256 mismatch)\n", dp->d_name); - unlink(binpkg); + if (unlink(binpkg) == -1) + fprintf(stderr, "Failed to remove " + "`%s': %s\n", binpkg, + strerror(errno)); } free(binpkg); continue; } printf("Removed %s from cachedir (obsolete)\n", dp->d_name); - unlink(binpkg); + if (unlink(binpkg) == -1) + fprintf(stderr, "Failed to remove `%s': %s\n", + binpkg, strerror(errno)); free(binpkg); } closedir(dirp);