start_devserver: cleaner handling of signals

This simplified and robustifies the signal handling and termination of
the child process (devserver) in several ways:

* There's no need to set a flag when trapping a signal: it is sufficient
  to check the return status of the wait built-in (if >= 128, it was
  interrupted by a signal).

* Be sure to wait for the subprocess' termination, regardless of
  repeated signals. This ensures that we do not leave zombie devservers
  behind.

* Note that this may send multiple SIGTERMs to the child process (one
  for each signal trapped by start_devserver).  This is probably
  harmless, and makes the code simpler.

BUG=None
TEST=devserver killed cleanly

Change-Id: Ibe648285b461048f681e464ab2ba6c9a7445841d
Reviewed-on: https://gerrit.chromium.org/gerrit/32114
Reviewed-by: Darin Petkov <[email protected]>
Reviewed-by: Richard Barnette <[email protected]>
Commit-Ready: Gilad Arnold <[email protected]>
Tested-by: Gilad Arnold <[email protected]>
1 file changed