winlin

always wait for process to terminated when SIGKILL.

@@ -274,8 +274,11 @@ int srs_kill_forced(int& pid) @@ -274,8 +274,11 @@ int srs_kill_forced(int& pid)
274 // other signals, directly exit(123), for example: 274 // other signals, directly exit(123), for example:
275 // 9) SIGKILL 15) SIGTERM 275 // 9) SIGKILL 15) SIGTERM
276 int status = 0; 276 int status = 0;
277 - if (waitpid(pid, &status, 0) < 0) {  
278 - return ERROR_SYSTEM_KILL; 277 + // @remark when we use SIGKILL to kill process, it must be killed,
  278 + // so we always wait it to quit by infinite loop.
  279 + while (waitpid(pid, &status, 0) < 0) {
  280 + st_usleep(10 * 1000);
  281 + continue;
279 } 282 }
280 283
281 srs_trace("SIGKILL stop process pid=%d ok.", pid); 284 srs_trace("SIGKILL stop process pid=%d ok.", pid);