Commit 3e254080 authored by chenhaowen01's avatar chenhaowen01

fixup socket error

parent 044dae42
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#define SOCKET int #define SOCKET int
#define INVALID_SOCKET -1
#endif #endif
#ifdef __WITH_POLARSSL__ #ifdef __WITH_POLARSSL__
...@@ -115,7 +116,7 @@ int auth(void) ...@@ -115,7 +116,7 @@ int auth(void)
local_addr.sin_port=htons(drcom_config.remote_port); local_addr.sin_port=htons(drcom_config.remote_port);
SOCKET client_sockfd; SOCKET client_sockfd;
if ((client_sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) if ((client_sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == INVALID_SOCKET)
{ {
fprintf(stderr, "error!\n"); fprintf(stderr, "error!\n");
fflush(stderr); fflush(stderr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment