fix build on win32

This commit is contained in:
Max Lv
2014-11-13 08:51:48 +08:00
parent 693b198887
commit 042749d533
2 changed files with 15 additions and 13 deletions
+10 -9
View File
@@ -183,8 +183,9 @@ int create_and_bind(const char *addr, const char *port)
static void free_connections(struct ev_loop *loop)
{
struct cork_dllist_item *curr;
for (curr = cork_dllist_start(&connections); !cork_dllist_is_end(&connections, curr);
curr = curr->next) {
for (curr = cork_dllist_start(&connections);
!cork_dllist_is_end(&connections, curr);
curr = curr->next) {
struct server *server = cork_container_of(curr, struct server, entries);
struct remote *remote = server->remote;
close_and_free_server(loop, server);
@@ -904,11 +905,11 @@ int main(int argc, char **argv)
int option_index = 0;
static struct option long_options[] =
{
{ "fast-open", no_argument, 0,
{ "fast-open", no_argument, 0,
0 },
{ "acl", required_argument, 0,
{ "acl", required_argument, 0,
0 },
{ 0, 0, 0,
{ 0, 0, 0,
0 }
};
@@ -1046,11 +1047,11 @@ int main(int argc, char **argv)
#ifdef __MINGW32__
winsock_init();
#endif
#else
// ignore SIGPIPE
signal(SIGPIPE, SIG_IGN);
signal(SIGABRT, SIG_IGN);
#endif
struct ev_signal sigint_watcher;
struct ev_signal sigterm_watcher;
@@ -1172,11 +1173,11 @@ int start_ss_local_server(profile_t profile)
#ifdef __MINGW32__
winsock_init();
#endif
#else
// ignore SIGPIPE
signal(SIGPIPE, SIG_IGN);
signal(SIGABRT, SIG_IGN);
#endif
struct ev_signal sigint_watcher;
struct ev_signal sigterm_watcher;
+5 -4
View File
@@ -99,8 +99,9 @@ static struct cork_dllist connections;
static void free_connections(struct ev_loop *loop)
{
struct cork_dllist_item *curr;
for (curr = cork_dllist_start(&connections); !cork_dllist_is_end(&connections, curr);
curr = curr->next) {
for (curr = cork_dllist_start(&connections);
!cork_dllist_is_end(&connections, curr);
curr = curr->next) {
struct server *server = cork_container_of(curr, struct server, entries);
struct remote *remote = server->remote;
close_and_free_server(loop, server);
@@ -925,8 +926,8 @@ int main(int argc, char **argv)
int option_index = 0;
static struct option long_options[] =
{
{ "fast-open", no_argument, 0, 0 },
{ 0, 0, 0, 0 }
{ "fast-open", no_argument, 0, 0 },
{ 0, 0, 0, 0 }
};
opterr = 0;