mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
build: avoid variable named 'interface', for mingw
Commit 2f36e6944 (re-)introduced a use of an identifier 'interface', which causes this build failure on mingw: ../../tools/virsh-domain-monitor.c: In function 'cmdDomIfAddr': ../../tools/virsh-domain-monitor.c:2233:17: error: expected identifier or '(' before 'struct' const char *interface = NULL; ^ See also commit 6512c8b. Sadly, I'm not quite sure how to write a syntax check that can poison the use of this identifier. * tools/virsh-domain-monitor.c (cmdDomIfAddr): Use ifacestr instead. Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
cf6ab17e45
commit
75d56f51f7
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* virsh-domain-monitor.c: Commands to monitor domain status
|
* virsh-domain-monitor.c: Commands to monitor domain status
|
||||||
*
|
*
|
||||||
* Copyright (C) 2005, 2007-2014 Red Hat, Inc.
|
* Copyright (C) 2005, 2007-2015 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -2230,7 +2230,7 @@ static bool
|
|||||||
cmdDomIfAddr(vshControl *ctl, const vshCmd *cmd)
|
cmdDomIfAddr(vshControl *ctl, const vshCmd *cmd)
|
||||||
{
|
{
|
||||||
virDomainPtr dom = NULL;
|
virDomainPtr dom = NULL;
|
||||||
const char *interface = NULL;
|
const char *ifacestr = NULL;
|
||||||
virDomainInterfacePtr *ifaces = NULL;
|
virDomainInterfacePtr *ifaces = NULL;
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
int ifaces_count = 0;
|
int ifaces_count = 0;
|
||||||
@ -2242,7 +2242,7 @@ cmdDomIfAddr(vshControl *ctl, const vshCmd *cmd)
|
|||||||
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
|
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (vshCommandOptString(cmd, "interface", &interface) < 0)
|
if (vshCommandOptString(cmd, "interface", &ifacestr) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
if (vshCommandOptString(cmd, "source", &sourcestr) < 0)
|
if (vshCommandOptString(cmd, "source", &sourcestr) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -2273,7 +2273,7 @@ cmdDomIfAddr(vshControl *ctl, const vshCmd *cmd)
|
|||||||
char *ip_addr_str = NULL;
|
char *ip_addr_str = NULL;
|
||||||
const char *type = NULL;
|
const char *type = NULL;
|
||||||
|
|
||||||
if (interface && STRNEQ(interface, iface->name))
|
if (ifacestr && STRNEQ(ifacestr, iface->name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* When the interface has no IP address */
|
/* When the interface has no IP address */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user