[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] testutils.c: unsetenv() iff platform has it



On 05/26/2016 09:40 AM, Michal Privoznik wrote:
> I've encountered the following problem (introduced by 6326865e):
> 
> ../../tests/testutils.c: In function 'virtTestRun':
> ../../tests/testutils.c:289:5: error: implicit declaration of function 'unsetenv' [-Werror=implicit-function-declaration]
>      unsetenv("VIR_TEST_MOCK_TESTNAME");
> 
> Apparently, mingw does not have unsetenv(). Therefore we should
> call it iff we are sure platform we are building for has it.
> 
> Signed-off-by: Michal Privoznik <mprivozn redhat com>
> ---
> 
> This is a tentative patch. Ideally, we would use gnulib's
> implementation (like we do for setenv()), but there are some
> licensing problems right now [1]. If they are resolved before our
> release, we can just pick new gnulib. If, however, they are not,
> we can just push this patch.

Conditional ACK; this is a nice fallback if the gnulib stuff doesn't
happen fast enough for us, but is indeed something we'd revert once
gnulib is ready.

> 
> 1: https://www.redhat.com/archives/libvir-list/2016-May/msg01952.html
> 
>  tests/testutils.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tests/testutils.c b/tests/testutils.c
> index f4fbad2..8b7bf70 100644
> --- a/tests/testutils.c
> +++ b/tests/testutils.c
> @@ -286,7 +286,9 @@ virtTestRun(const char *title,
>      }
>  #endif /* TEST_OOM */
>  
> +#ifdef HAVE_UNSETENV
>      unsetenv("VIR_TEST_MOCK_TESTNAME");
> +#endif
>      return ret;
>  }
>  
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]