Browse Source

Fix compiler warnings: remove incorrect address-of operator and add getpid for Windows

- etcp_connections.c:1142: remove & before addr in sockaddr_storage_to_str call
- test_etcp_simple_traffic.c: add #include <process.h> and #define getpid _getpid for Windows
congestion
Evgeny 5 months ago
parent
commit
11d511797a
  1. 2
      src/etcp_connections.c
  2. 2
      tests/test_etcp_simple_traffic.c

2
src/etcp_connections.c

@ -1139,7 +1139,7 @@ int etcp_send_ping(struct UTUN_INSTANCE* instance, const uint8_t* peer_pubkey_bi
DEBUG_ERROR(DEBUG_CATEGORY_BGP, "no socket");
return -2;
}
DEBUG_ERROR(DEBUG_CATEGORY_CONNECTION, "ping N1 [%s]", sockaddr_storage_to_str(&addr).str);
DEBUG_ERROR(DEBUG_CATEGORY_CONNECTION, "ping N1 [%s]", sockaddr_storage_to_str(addr).str);
return etcp_send_ping_to_socket(instance, e_sock, peer_pubkey_bin, addr, timeout_ms,
cb, user_arg, user_data, user_data_len);
}

2
tests/test_etcp_simple_traffic.c

@ -6,6 +6,8 @@
#ifdef _WIN32
#include <windows.h>
#include <direct.h>
#include <process.h>
#define getpid _getpid
#else
#include <unistd.h>
#endif

Loading…
Cancel
Save