mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
virSecuritySELinuxTransactionCommit: Return -1 if no transaction is set
Return -1 and report an error message if no transaction is set and virSecuritySELinuxTransactionCommit is called. The function description of virSecuritySELinuxTransactionCommit says: "Also it is considered as error if there's no transaction set and this function is called." Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
This commit is contained in:
parent
8d8f6b4e88
commit
1458746f05
@ -1094,8 +1094,11 @@ virSecuritySELinuxTransactionCommit(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED,
|
||||
int ret = -1;
|
||||
|
||||
list = virThreadLocalGet(&contextList);
|
||||
if (!list)
|
||||
return 0;
|
||||
if (!list) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("No transaction is set"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (virThreadLocalSet(&contextList, NULL) < 0) {
|
||||
virReportSystemError(errno, "%s",
|
||||
|
Loading…
x
Reference in New Issue
Block a user