xbps-repo: [clean] print err msg when unlink(2) fails.
This commit is contained in:
parent
f4e97228c8
commit
5cb0d17f8e
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user