27.05.2016 12:20, Nikolay Shirokovskiy пишет:
On 26.05.2016 13:14, Maxim Nestratov wrote:
> when additional information is asked PrlJob_GetError an error
> PRL_ERR_NO_DATA should not be treated as error
>
> Signed-off-by: Maxim Nestratov <mnestratov(a)virtuozzo.com>
> ---
> src/vz/vz_sdk.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
> index 7fc7d97..bad4ddd 100644
> --- a/src/vz/vz_sdk.c
> +++ b/src/vz/vz_sdk.c
> @@ -162,7 +162,8 @@ getJobResultHelper(PRL_HANDLE job, unsigned int timeout,
PRL_HANDLE *result,
> PRL_HANDLE err_handle;
>
> /* Sometimes it's possible to get additional error info. */
> - if ((ret = PrlJob_GetError(job, &err_handle))) {
> + ret = PrlJob_GetError(job, &err_handle);
> + if (ret && ret != PRL_ERR_NO_DATA) {
> logPrlErrorHelper(ret, filename, funcname, linenr);
> goto cleanup;
> }
>
I would log and return in case of PRL_ERR_NO_DATA or it is rather compilicated
to call logPrlEventErrorHelper only to return immediately.
I squashed this patch with the previous and reworked it a bit.
Sent a new version.
Maxim