Skip to content

Commit 042749d

Browse files
committed
fix build on win32
1 parent 693b198 commit 042749d

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

src/local.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,9 @@ int create_and_bind(const char *addr, const char *port)
183183
static void free_connections(struct ev_loop *loop)
184184
{
185185
struct cork_dllist_item *curr;
186-
for (curr = cork_dllist_start(&connections); !cork_dllist_is_end(&connections, curr);
187-
curr = curr->next) {
186+
for (curr = cork_dllist_start(&connections);
187+
!cork_dllist_is_end(&connections, curr);
188+
curr = curr->next) {
188189
struct server *server = cork_container_of(curr, struct server, entries);
189190
struct remote *remote = server->remote;
190191
close_and_free_server(loop, server);
@@ -904,11 +905,11 @@ int main(int argc, char **argv)
904905
int option_index = 0;
905906
static struct option long_options[] =
906907
{
907-
{ "fast-open", no_argument, 0,
908+
{ "fast-open", no_argument, 0,
908909
0 },
909-
{ "acl", required_argument, 0,
910+
{ "acl", required_argument, 0,
910911
0 },
911-
{ 0, 0, 0,
912+
{ 0, 0, 0,
912913
0 }
913914
};
914915

@@ -1046,11 +1047,11 @@ int main(int argc, char **argv)
10461047

10471048
#ifdef __MINGW32__
10481049
winsock_init();
1049-
#endif
1050-
1050+
#else
10511051
// ignore SIGPIPE
10521052
signal(SIGPIPE, SIG_IGN);
10531053
signal(SIGABRT, SIG_IGN);
1054+
#endif
10541055

10551056
struct ev_signal sigint_watcher;
10561057
struct ev_signal sigterm_watcher;
@@ -1172,11 +1173,11 @@ int start_ss_local_server(profile_t profile)
11721173

11731174
#ifdef __MINGW32__
11741175
winsock_init();
1175-
#endif
1176-
1176+
#else
11771177
// ignore SIGPIPE
11781178
signal(SIGPIPE, SIG_IGN);
11791179
signal(SIGABRT, SIG_IGN);
1180+
#endif
11801181

11811182
struct ev_signal sigint_watcher;
11821183
struct ev_signal sigterm_watcher;

src/server.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@ static struct cork_dllist connections;
9999
static void free_connections(struct ev_loop *loop)
100100
{
101101
struct cork_dllist_item *curr;
102-
for (curr = cork_dllist_start(&connections); !cork_dllist_is_end(&connections, curr);
103-
curr = curr->next) {
102+
for (curr = cork_dllist_start(&connections);
103+
!cork_dllist_is_end(&connections, curr);
104+
curr = curr->next) {
104105
struct server *server = cork_container_of(curr, struct server, entries);
105106
struct remote *remote = server->remote;
106107
close_and_free_server(loop, server);
@@ -925,8 +926,8 @@ int main(int argc, char **argv)
925926
int option_index = 0;
926927
static struct option long_options[] =
927928
{
928-
{ "fast-open", no_argument, 0, 0 },
929-
{ 0, 0, 0, 0 }
929+
{ "fast-open", no_argument, 0, 0 },
930+
{ 0, 0, 0, 0 }
930931
};
931932

932933
opterr = 0;

0 commit comments

Comments
 (0)