index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Andrew Gregory <andrew.gregory.8@gmail.com> | 2014-08-01 14:19:51 -0700 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2014-08-04 14:23:58 +1000 |
commit | 0bf4ae726d6a98142a176b9ac0b9ed8f00389e67 (patch) | |
tree | 27960cde838d1dc649bdc30c3457408ff3c232d8 /lib/libalpm/handle.c | |
parent | 03b9bf08ac3b1e3f2c3b950ce995654af2c40503 (diff) |
-rw-r--r-- | lib/libalpm/handle.c | 20 |
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 234fc4d0..0efc0a96 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -125,12 +125,20 @@ int _alpm_handle_unlock(alpm_handle_t *handle) close(handle->lockfd); 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; + if(unlink(handle->lockfile) != 0) { + if(errno == ENOENT) { + _alpm_log(handle, ALPM_LOG_WARNING, + _("lock file missing %s\n"), handle->lockfile); + alpm_logaction(handle, ALPM_CALLER_PREFIX, + "warning: lock file missing %s\n", handle->lockfile); + return 0; + } else { + _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; } |