Browse Source

Fix #1974

pull/1978/head
Max Lv 7 years ago
parent
commit
a377c5114a
4 changed files with 21 additions and 9 deletions
  1. 9
      src/local.c
  2. 7
      src/redir.c
  3. 7
      src/server.c
  4. 7
      src/tunnel.c

9
src/local.c

@ -102,6 +102,7 @@ static int ipv6first = 0;
static int fast_open = 0;
static int no_delay = 0;
static int udp_fd = 0;
static int ret_val = 0;
static struct ev_signal sigint_watcher;
static struct ev_signal sigterm_watcher;
@ -1296,8 +1297,10 @@ signal_cb(EV_P_ ev_signal *w, int revents)
switch (w->signum) {
#ifndef __MINGW32__
case SIGCHLD:
if (!is_plugin_running())
if (!is_plugin_running()) {
LOGE("plugin service exit unexpectedly");
ret_val = -1;
}
else
return;
case SIGUSR1:
@ -1820,7 +1823,7 @@ main(int argc, char **argv)
winsock_cleanup();
#endif
return 0;
return ret_val;
}
#else
@ -1969,7 +1972,7 @@ _start_ss_local_server(profile_t profile, ss_local_callback callback, void *udat
winsock_cleanup();
#endif
return 0;
return ret_val;
}
int

7
src/redir.c

@ -96,6 +96,7 @@ static int nofile = 0;
#endif
static int fast_open = 0;
static int no_delay = 0;
static int ret_val = 0;
static struct ev_signal sigint_watcher;
static struct ev_signal sigterm_watcher;
@ -819,8 +820,10 @@ signal_cb(EV_P_ ev_signal *w, int revents)
if (revents & EV_SIGNAL) {
switch (w->signum) {
case SIGCHLD:
if (!is_plugin_running())
if (!is_plugin_running()) {
LOGE("plugin service exit unexpectedly");
ret_val = -1;
}
else
return;
case SIGINT:
@ -1258,5 +1261,5 @@ main(int argc, char **argv)
stop_plugin();
}
return 0;
return ret_val;
}

7
src/server.c

@ -122,6 +122,7 @@ static int mode = TCP_ONLY;
static int ipv6first = 0;
static int fast_open = 0;
static int no_delay = 0;
static int ret_val = 0;
#ifdef HAVE_SETRLIMIT
static int nofile = 0;
@ -1495,8 +1496,10 @@ signal_cb(EV_P_ ev_signal *w, int revents)
switch (w->signum) {
#ifndef __MINGW32__
case SIGCHLD:
if (!is_plugin_running())
if (!is_plugin_running()) {
LOGE("plugin service exit unexpectedly");
ret_val = -1;
}
else
return;
#endif
@ -2069,5 +2072,5 @@ main(int argc, char **argv)
winsock_cleanup();
#endif
return 0;
return ret_val;
}

7
src/tunnel.c

@ -96,6 +96,7 @@ static int mode = TCP_ONLY;
static int nofile = 0;
#endif
static int no_delay = 0;
static int ret_val = 0;
static struct ev_signal sigint_watcher;
static struct ev_signal sigterm_watcher;
@ -745,8 +746,10 @@ signal_cb(EV_P_ ev_signal *w, int revents)
switch (w->signum) {
#ifndef __MINGW32__
case SIGCHLD:
if (!is_plugin_running())
if (!is_plugin_running()) {
LOGE("plugin service exit unexpectedly");
ret_val = -1;
}
else
return;
#endif
@ -1197,5 +1200,5 @@ main(int argc, char **argv)
winsock_cleanup();
#endif
return 0;
return ret_val;
}
Loading…
Cancel
Save