mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04: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:
|
cleanup:
|
||||||
|
_alpm_handle_unlock(handle);
|
||||||
if(_alpm_handle_unlock(handle)) {
|
|
||||||
_alpm_log(handle, ALPM_LOG_WARNING, _("could not remove lock file %s\n"),
|
|
||||||
handle->lockfile);
|
|
||||||
}
|
|
||||||
free(syncpath);
|
free(syncpath);
|
||||||
umask(oldmask);
|
umask(oldmask);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -126,6 +126,10 @@ int _alpm_handle_unlock(alpm_handle_t *handle)
|
|||||||
handle->lockfd = -1;
|
handle->lockfd = -1;
|
||||||
|
|
||||||
if(unlink(handle->lockfile) && errno != ENOENT) {
|
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 -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -231,12 +231,7 @@ int SYMEXPORT alpm_trans_release(alpm_handle_t *handle)
|
|||||||
|
|
||||||
/* unlock db */
|
/* unlock db */
|
||||||
if(!nolock_flag) {
|
if(!nolock_flag) {
|
||||||
if(_alpm_handle_unlock(handle)) {
|
_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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user