[pacman-dev] [PATCH 01/11] handle_unlock: return 0 if lockfile == NULL

Andrew Gregory andrew.gregory.8 at gmail.com
Fri Dec 4 20:31:32 UTC 2015


Returning -1 is useless since we don't provide any way
to determine why it failed.

Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
---
 lib/libalpm/handle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 98420b0..b2a10c8 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -129,7 +129,7 @@ int _alpm_handle_lock(alpm_handle_t *handle)
 /** Remove a lock file */
 int _alpm_handle_unlock(alpm_handle_t *handle)
 {
-	ASSERT(handle->lockfile != NULL, return -1);
+	ASSERT(handle->lockfile != NULL, return 0);
 	ASSERT(handle->lockfd >= 0, return 0);
 
 	close(handle->lockfd);
-- 
2.6.3


More information about the pacman-dev mailing list