From bf324d848cffa0b5b567cfa6d31c0fb1ec096ec6 Mon Sep 17 00:00:00 2001 From: chenhw2 Date: Sat, 8 Jul 2017 22:24:05 +0800 Subject: [PATCH] fix https://github.com/shadowsocksr/shadowsocksr-libev/issues/63 (#66) --- src/local.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/local.c b/src/local.c index ddfbac3c..e9ce536d 100644 --- a/src/local.c +++ b/src/local.c @@ -1099,7 +1099,11 @@ remote_send_cb(EV_P_ ev_io *w, int revents) if (!remote_send_ctx->connected) { int err_no = 0; socklen_t len = sizeof err_no; - int r = getsockopt(remote->fd, SOL_SOCKET, SO_ERROR, &err_no, &len); +#ifdef __MINGW32__ + int r = getsockopt(remote->fd, SOL_SOCKET, SO_ERROR, (char *)&err_no, &len); +#else + int r = getsockopt(remote->fd, SOL_SOCKET, SO_ERROR, &err_no, &len); +#endif if (r == 0 && err_no == 0) { remote_send_ctx->connected = 1; ev_timer_stop(EV_A_ & remote_send_ctx->watcher);