xbps_repo_close: only unlock the file lock if repo was opened as such.
If xbps_repo_open() was called with the lock arg set, xbps_repo_close() will now unlock the repo file lock, without the need to set it. This avoids the need to always unlock the file lock even if it wasn't locked previously. This also introduceds an ABI/API break, but this way it's cleaner.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* Copyright (c) 2012-2014 Juan Romero Pardines.
|
||||
* Copyright (c) 2012-2015 Juan Romero Pardines.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -216,7 +216,7 @@ index_add(struct xbps_handle *xhp, int args, int argmax, char **argv, bool force
|
||||
|
||||
out:
|
||||
if (repo)
|
||||
xbps_repo_close(repo, true);
|
||||
xbps_repo_close(repo);
|
||||
if (tmprepodir)
|
||||
free(tmprepodir);
|
||||
|
||||
|
Reference in New Issue
Block a user