From 5cb0d17f8e877cc286160dca91b63bd948ce7f13 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 19 Jun 2012 10:55:42 +0200 Subject: [PATCH] xbps-repo: [clean] print err msg when unlink(2) fails. --- bin/xbps-repo/clean.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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);