This patch rewrites conditions to make the code easier and less structured. Signed-off-by: Kristina Hanicova <khanicov@xxxxxxxxxx> --- src/conf/domain_conf.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1c29a2d929..e52f39c809 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3999,15 +3999,15 @@ int virDomainObjWaitUntil(virDomainObj *vm, unsigned long long whenms) { - if (virCondWaitUntil(&vm->cond, &vm->parent.lock, whenms) < 0) { - if (errno != ETIMEDOUT) { - virReportSystemError(errno, "%s", - _("failed to wait for domain condition")); - return -1; - } + if (virCondWaitUntil(&vm->cond, &vm->parent.lock, whenms) >= 0) + return 0; + + if (errno == ETIMEDOUT) return 1; - } - return 0; + + virReportSystemError(errno, "%s", + _("failed to wait for domain condition")); + return -1; } -- 2.35.3