]> git.ipfire.org Git - thirdparty/kea.git/commit
[#3025] fix ProcessSpawn on BSD
authorAndrei Pavel <andrei@isc.org>
Fri, 23 Feb 2024 18:01:00 +0000 (20:01 +0200)
committerAndrei Pavel <andrei@isc.org>
Fri, 23 Feb 2024 18:01:00 +0000 (20:01 +0200)
commit6bfbdab033eed9a900f49d56d7da866df8e5593c
tree4a6da7612e4d223847ebce5aab23df3aa39d8d95
parenta91ebc6e7b638bfb2a61c3663785bcbf43be6c92
[#3025] fix ProcessSpawn on BSD

- Always break after collecting exit status. Previously it broke the
  loop always on failure of waitpid which does happen after calling it
  subsequently, but there is no reason to wait until then.
- When waitpid returns -1 in sync mode, throw exception, except for
  EINTR which happens on signals (usually one time) prior to
  the child process exiting if sigaction is called without SA_RESTART
  which is the default on some systems.
- Only initialize the global IO signal set on the IO service in async
  mode. It makes no sense to do it in sync mode because there is no IO service.
- Swap pid and wpid names to conform to names in `man wait` on BSD.
- Add FAIL() on timer expiration.
- Don't call runOne() the third time in unit tests because it waits for
  the timer to expire.
src/lib/asiolink/process_spawn.cc
src/lib/asiolink/tests/process_spawn_unittest.cc