mirror of
https://github.com/moparisthebest/pacman
synced 2025-02-28 17:31:52 -05:00
handle_unlock: log lock removal failure
Rather than have individual callers log failure, just do it directly in _alpm_handle_unlock. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
7f1360b440
commit
03b9bf08ac
@ -291,11 +291,7 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
|
||||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
if(_alpm_handle_unlock(handle)) {
|
||||
_alpm_log(handle, ALPM_LOG_WARNING, _("could not remove lock file %s\n"),
|
||||
handle->lockfile);
|
||||
}
|
||||
_alpm_handle_unlock(handle);
|
||||
free(syncpath);
|
||||
umask(oldmask);
|
||||
return ret;
|
||||
|
@ -126,6 +126,10 @@ int _alpm_handle_unlock(alpm_handle_t *handle)
|
||||
handle->lockfd = -1;
|
||||
|
||||
if(unlink(handle->lockfile) && errno != ENOENT) {
|
||||
_alpm_log(handle, ALPM_LOG_WARNING,
|
||||
_("could not remove lock file %s\n"), handle->lockfile);
|
||||
alpm_logaction(handle, ALPM_CALLER_PREFIX,
|
||||
"warning: could not remove lock file %s\n", handle->lockfile);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -231,12 +231,7 @@ int SYMEXPORT alpm_trans_release(alpm_handle_t *handle)
|
||||
|
||||
/* unlock db */
|
||||
if(!nolock_flag) {
|
||||
if(_alpm_handle_unlock(handle)) {
|
||||
_alpm_log(handle, ALPM_LOG_WARNING, _("could not remove lock file %s\n"),
|
||||
handle->lockfile);
|
||||
alpm_logaction(handle, ALPM_CALLER_PREFIX,
|
||||
"warning: could not remove lock file %s\n", handle->lockfile);
|
||||
}
|
||||
_alpm_handle_unlock(handle);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user