Fix a build failure in dbgport when using clang modules

xhyve/src/dbgport.c:51:27: error: redefinition of 'sin' as different kind of symbol
static struct sockaddr_in sin;
                          ^
In module 'Darwin' imported from xhyve/src/dbgport.c:30:
/usr/include/math.h:343:15: note: previous definition is here
extern double sin(double);
              ^
xhyve/src/dbgport.c:126:2: warning: implicitly declaring library function 'sin' with
type
      'double (double)'
        sin.sin_len = sizeof(sin);
        ^
xhyve/src/dbgport.c:126:2: note: include the header <math.h> or explicitly provide a
      declaration for 'sin'

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
This commit is contained in:
Jeremy Huddleston Sequoia 2015-11-14 12:18:01 -08:00
parent 553755f94c
commit d6a61cf079

View file

@ -48,7 +48,7 @@
static int listen_fd, conn_fd;
static struct sockaddr_in sin;
static struct sockaddr_in saddrin;
static int
dbg_handler(UNUSED int vcpu, int in, UNUSED int port, int bytes, uint32_t *eax,
@ -123,12 +123,12 @@ init_dbgport(int sport)
exit(1);
}
sin.sin_len = sizeof(sin);
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = htonl(INADDR_ANY);
sin.sin_port = htons(sport);
saddrin.sin_len = sizeof(saddrin);
saddrin.sin_family = AF_INET;
saddrin.sin_addr.s_addr = htonl(INADDR_ANY);
saddrin.sin_port = htons(sport);
if (bind(listen_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
if (bind(listen_fd, (struct sockaddr *)&saddrin, sizeof(saddrin)) < 0) {
perror("bind");
exit(1);
}