Skip to content

Commit d15e1f2

Browse files
committed
Fixed the issue where new connection startup got stuck due to the wrong order of terminating processes.
1 parent 30ab100 commit d15e1f2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/debug-server.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#define COMMAND_PORT 9545
66
#define GDBSERVER_PORT 9549
77

8-
#define VERSION "1.5.1"
8+
#define VERSION "1.5.2"
99

1010
#define COMMAND_GDB_REGISTER 0x01
1111
#define COMMAND_GDBSERVER_ATTACH 0x02

src/service.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,6 @@ int start_service(int client_sock)
104104
{
105105
struct rlimit limit;
106106

107-
if(!arg_opt_m && service_pid != -1)
108-
{
109-
kill(service_pid, SIGKILL);
110-
CHECK(waitpid(service_pid, NULL, 0) == service_pid);
111-
service_pid = -1;
112-
}
113-
114107
if(gdbserver_pid != -1)
115108
{
116109
kill(gdbserver_pid, SIGTERM);
@@ -125,6 +118,13 @@ int start_service(int client_sock)
125118
strace_pid = -1;
126119
}
127120

121+
if(!arg_opt_m && service_pid != -1)
122+
{
123+
kill(service_pid, SIGKILL);
124+
CHECK(waitpid(service_pid, NULL, 0) == service_pid);
125+
service_pid = -1;
126+
}
127+
128128
service_pid = fork();
129129
if(service_pid == -1)
130130
{

0 commit comments

Comments
 (0)