Added strerror() output on unlink failure
This commit is contained in:
parent
1bea7706ae
commit
f6a76dac12
1 changed files with 69 additions and 67 deletions
|
@ -37,6 +37,8 @@
|
|||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <libintl.h>
|
||||
/* pacman */
|
||||
#include "list.h"
|
||||
|
@ -224,8 +226,8 @@ static void unlink_file(pmpkg_t *info, pmlist_t *lp, pmlist_t *targ,
|
|||
PROGRESS(trans, PM_TRANS_PROGRESS_REMOVE_START, info->name, (double)(percent * 100), list_count, (list_count - _alpm_list_count(targ) + 1));
|
||||
++(*position);
|
||||
}
|
||||
if ( unlink(file) ) {
|
||||
_alpm_log(PM_LOG_ERROR, _("cannot remove file %s"), file);
|
||||
if (unlink(file) == -1) {
|
||||
_alpm_log(PM_LOG_ERROR, _("cannot remove file %s: %s"), file, strerror(errno));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue