Skip to content

Commit 6b376b2

Browse files
jeroenajdavis
authored andcommitted
Windows: fix compiler warnings
1 parent b7138ce commit 6b376b2

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/mongoc/mongoc-cluster-sspi.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,8 @@ _mongoc_cluster_auth_node_sspi (mongoc_cluster_t *cluster,
149149
bson_t cmd;
150150
int res = MONGOC_SSPI_AUTH_GSS_CONTINUE;
151151
int step;
152-
const bson_t *options;
153152
mongoc_server_stream_t *server_stream;
154153

155-
options = mongoc_uri_get_options (cluster->uri);
156154
state = _mongoc_cluster_sspi_new (cluster->uri, sd->host.host);
157155

158156
if (!state) {

src/mongoc/mongoc-socket.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "mongoc-trace-private.h"
2727
#ifdef _WIN32
2828
#include <Mstcpip.h>
29+
#include <process.h>
2930
#endif
3031

3132
#undef MONGOC_LOG_DOMAIN
@@ -351,7 +352,6 @@ mongoc_socket_poll (mongoc_socket_poll_t *sds, /* IN */
351352
static void
352353
_mongoc_socket_setkeepalive_windows (SOCKET sd)
353354
{
354-
BOOL optval = 1;
355355
struct tcp_keepalive keepalive;
356356
DWORD lpcbBytesReturned = 0;
357357
HKEY hKey;
@@ -415,9 +415,9 @@ _mongoc_socket_setkeepalive_windows (SOCKET sd)
415415
&lpcbBytesReturned,
416416
NULL,
417417
NULL) == SOCKET_ERROR) {
418-
TRACE ("Could not set keepalive values");
418+
TRACE ("%s", "Could not set keepalive values");
419419
} else {
420-
TRACE ("KeepAlive values updated");
420+
TRACE ("%s", "KeepAlive values updated");
421421
TRACE ("KeepAliveTime: %d", keepalive.keepalivetime);
422422
TRACE ("KeepAliveInterval: %d", keepalive.keepaliveinterval);
423423
}
@@ -1000,7 +1000,11 @@ mongoc_socket_new (int domain, /* IN */
10001000
sock = (mongoc_socket_t *) bson_malloc0 (sizeof *sock);
10011001
sock->sd = sd;
10021002
sock->domain = domain;
1003+
#ifdef _WIN32
1004+
sock->pid = (int) _getpid ();
1005+
#else
10031006
sock->pid = (int) getpid ();
1007+
#endif
10041008

10051009
RETURN (sock);
10061010

0 commit comments

Comments
 (0)