mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-30 05:11:14 +00:00
Fix #1974
This commit is contained in:
+6
-3
@@ -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
|
||||
|
||||
+5
-2
@@ -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;
|
||||
}
|
||||
|
||||
+5
-2
@@ -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;
|
||||
}
|
||||
|
||||
+5
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user