[libvirt] [PATCH] dnsmasqReload: avoid mingw link failure

Matthias Bolte matthias.bolte at googlemail.com
Mon May 3 18:43:18 UTC 2010


2010/5/3 Eric Blake <eblake at redhat.com>:
> * src/util/dnsmasq.c (dnsmasqReload): Mingw lacks kill, but is not
> running a dnsmasq daemon either.
> ---
>
> I'm not as familiar with the mingw cross-build setup, but I finally
> got enough pieces installed on my F-12 machine that this was the only
> remaining compilation failure that I ran into.  Let me know if we need
> an alternate patch that solves dnsmasq more gracefully than just
> crippling one function.

There's no dnsmasq to kill on Windows. I think this fix is fine.

>  src/util/dnsmasq.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/src/util/dnsmasq.c b/src/util/dnsmasq.c
> index 1cb5f21..d6cef40 100644
> --- a/src/util/dnsmasq.c
> +++ b/src/util/dnsmasq.c
> @@ -328,14 +328,16 @@ dnsmasqDelete(const dnsmasqContext *ctx)
>  * Reloads all the configurations associated to a context
>  */
>  int
> -dnsmasqReload(pid_t pid)
> +dnsmasqReload(pid_t pid ATTRIBUTE_UNUSED)
>  {
> +#ifndef __MINGW32__

Typically, WIN32 instead of __MINGW32__ is used in the libvirt code
base. Cygwin doesn't define WIN32, so this won't interfere with a
Cygwin build.

>     if (kill(pid, SIGHUP) != 0) {
>         virReportSystemError(errno,
>             _("Failed to make dnsmasq (PID: %d) reload config files.\n"),

You could kill the \n here.

>             pid);
>         return -1;
>     }
> +#endif /* __MINGW32__ */
>
>     return 0;
>  }
> --
> 1.6.6.1
>

ACK

Matthias




More information about the libvir-list mailing list