lu_start() will only set errno when it returns NULL. For all the
other cases, the value is unknown.
This means that when lu_start() returns an error message, it may not
be propagated to the client.
The check that errno is a non-zero value is now dropped and instead
the value is returned when no error message is provided. This
relies on errno to always be set when ret == NULL.
Fixes: af216a99fb ("tools/xenstore: add the basic framework for doing the live update")
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
return EINVAL;
}
ret = lu_start(ctx, conn, force, to);
- if (errno)
- return errno;
if (!ret)
- return 0;
+ return errno;
} else {
errno = 0;
ret = lu_arch(ctx, conn, vec, num);