modified to make generic

This commit is contained in:
skarg
2005-05-04 15:53:09 +00:00
parent d972d88b5d
commit 05645df358
+5 -5
View File
@@ -34,7 +34,7 @@
#include <stdint.h> // for standard integer types uint8_t etc. #include <stdint.h> // for standard integer types uint8_t etc.
#include <stdbool.h> // for the standard bool type. #include <stdbool.h> // for the standard bool type.
#include <socket.h> #include "net.h" // local port of the stack network includes
#include "bacdcode.h" #include "bacdcode.h"
#include "bip.h" #include "bip.h"
@@ -54,7 +54,7 @@ bool bip_valid(void)
void bip_cleanup(void) void bip_cleanup(void)
{ {
if (bip_valid()) if (bip_valid())
closesocket(BIP_Receive_Socket); close(BIP_Receive_Socket);
BIP_Receive_Socket = -1; BIP_Receive_Socket = -1;
return; return;
@@ -110,7 +110,7 @@ bool bip_init(void)
(const struct sockaddr*)&sin, sizeof(struct sockaddr)); (const struct sockaddr*)&sin, sizeof(struct sockaddr));
if (rv < 0) if (rv < 0)
{ {
closesocket(BIP_Receive_Socket); close(BIP_Receive_Socket);
BIP_Receive_Socket = -1; BIP_Receive_Socket = -1;
return false; return false;
} }
@@ -146,7 +146,7 @@ static int bip_send(
sizeof(struct sockaddr)); sizeof(struct sockaddr));
if (bip_send_socket < 0) if (bip_send_socket < 0)
{ {
closesocket(bip_send_socket); close(bip_send_socket);
return status; return status;
} }
@@ -167,7 +167,7 @@ static int bip_send(
if (rv >= 0) if (rv >= 0)
status = 0; status = 0;
closesocket(bip_send_socket); close(bip_send_socket);
return status; return status;
} }