Skip to content
Snippets Groups Projects
Commit 9d976580 authored by Philippe Mathieu-Daudé's avatar Philippe Mathieu-Daudé Committed by Eric Blake
Browse files

qemu-nbd: Rename 'exp' variable clashing with math::exp() symbol


The use of a variable named 'exp' prevents includes to import <math.h>.

Rename it to avoid:

  qemu-nbd.c:64:19: error: ‘exp’ redeclared as different kind of symbol
   static NBDExport *exp;
                     ^~~
  In file included from /usr/include/features.h:428,
                   from /usr/include/bits/libc-header-start.h:33,
                   from /usr/include/stdint.h:26,
                   from /usr/lib/gcc/x86_64-redhat-linux/8/include/stdint.h:9,
                   from /source/qemu/include/qemu/osdep.h:80,
                   from /source/qemu/qemu-nbd.c:19:
  /usr/include/bits/mathcalls.h:95:1: note: previous declaration of ‘exp’ was here
    __MATHCALL_VEC (exp,, (_Mdouble_ __x));
    ^~~~~~~~~~~~~~

Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Message-Id: <20190111163519.11457-1-philmd@redhat.com>
Signed-off-by: default avatarEric Blake <eblake@redhat.com>
parent 14da540f
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
#define MBR_SIZE 512 #define MBR_SIZE 512
static NBDExport *exp; static NBDExport *export;
static int verbose; static int verbose;
static char *srcpath; static char *srcpath;
static SocketAddress *saddr; static SocketAddress *saddr;
...@@ -335,7 +335,7 @@ static int nbd_can_accept(void) ...@@ -335,7 +335,7 @@ static int nbd_can_accept(void)
return state == RUNNING && nb_fds < shared; return state == RUNNING && nb_fds < shared;
} }
static void nbd_export_closed(NBDExport *exp) static void nbd_export_closed(NBDExport *export)
{ {
assert(state == TERMINATING); assert(state == TERMINATING);
state = TERMINATED; state = TERMINATED;
...@@ -1015,10 +1015,11 @@ int main(int argc, char **argv) ...@@ -1015,10 +1015,11 @@ int main(int argc, char **argv)
} }
} }
exp = nbd_export_new(bs, dev_offset, fd_size, nbdflags, nbd_export_closed, export = nbd_export_new(bs, dev_offset, fd_size, nbdflags,
writethrough, NULL, &error_fatal); nbd_export_closed, writethrough,
nbd_export_set_name(exp, export_name); NULL, &error_fatal);
nbd_export_set_description(exp, export_description); nbd_export_set_name(export, export_name);
nbd_export_set_description(export, export_description);
if (device) { if (device) {
#if HAVE_NBD_DEVICE #if HAVE_NBD_DEVICE
...@@ -1055,9 +1056,9 @@ int main(int argc, char **argv) ...@@ -1055,9 +1056,9 @@ int main(int argc, char **argv)
main_loop_wait(false); main_loop_wait(false);
if (state == TERMINATE) { if (state == TERMINATE) {
state = TERMINATING; state = TERMINATING;
nbd_export_close(exp); nbd_export_close(export);
nbd_export_put(exp); nbd_export_put(export);
exp = NULL; export = NULL;
} }
} while (state != TERMINATED); } while (state != TERMINATED);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment