From 705a04b92f21421a2a21c265f8cfbce5df23d1bd Mon Sep 17 00:00:00 2001 From: skarg Date: Mon, 15 Aug 2005 17:53:13 +0000 Subject: [PATCH] fixed compile errors --- bacnet-stack/ports/rtos32/bip-init.c | 12 +++++++----- bacnet-stack/ports/rtos32/makefile.mak | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/bacnet-stack/ports/rtos32/bip-init.c b/bacnet-stack/ports/rtos32/bip-init.c index 5acba4c0..5c53675f 100644 --- a/bacnet-stack/ports/rtos32/bip-init.c +++ b/bacnet-stack/ports/rtos32/bip-init.c @@ -41,10 +41,12 @@ bool bip_init(void) int rv = 0; // return from socket lib calls struct sockaddr_in sin = {-1}; int value = 1; + int sock_fd = -1; // assumes that the driver has already been initialized - BIP_Socket = socket(AF_INET, SOCK_DGRAM, IPROTO_UDP); - if (BIP_Socket < 0) + sock_fd = socket(AF_INET, SOCK_DGRAM, IPROTO_UDP); + bip_set_socket(sock_fd); + if (sock_fd < 0) return false; // bind the socket to the local port number and IP address @@ -52,12 +54,12 @@ bool bip_init(void) sin.sin_addr.s_addr = htonl(INADDR_ANY); sin.sin_port = htons(bip_get_port()); memset(&(sin.sin_zero), '\0', 8); - rv = bind(BIP_Socket, + rv = bind(sock_fd, (const struct sockaddr*)&sin, sizeof(struct sockaddr)); if (rv < 0) { - close(BIP_Socket); - BIP_Socket = -1; + close(sock_fd); + bip_set_socket(-1); return false; } diff --git a/bacnet-stack/ports/rtos32/makefile.mak b/bacnet-stack/ports/rtos32/makefile.mak index cce9aa02..0aa92cb4 100644 --- a/bacnet-stack/ports/rtos32/makefile.mak +++ b/bacnet-stack/ports/rtos32/makefile.mak @@ -40,6 +40,7 @@ SRCS = init.c main.c ethernet.c bip-init.c \ ..\..\wp.c \ ..\..\arf.c \ ..\..\awf.c \ + ..\..\bacfile.c \ ..\..\device.c \ ..\..\ai.c \ ..\..\ao.c \