]> granicus.if.org Git - libevent/commit
tests: use waitpid(..., WNOWAIT) to fix failing of main/fork under solaris
authorAzat Khuzhin <a3at.mail@gmail.com>
Thu, 11 Aug 2016 13:15:45 +0000 (16:15 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Thu, 11 Aug 2016 14:08:35 +0000 (17:08 +0300)
commit43eb56c7c738e3642f0981e3dd6ab9e082eec798
treebdc7b663d47d9d08fcc8fb2a0d2534bf6fd19e8b
parent16d220cb6fa23a16733b292eee7008097f5570eb
tests: use waitpid(..., WNOWAIT) to fix failing of main/fork under solaris

According to solaris docs:
  "One instance of a SIGCHLD signal is queued for each child process whose
  status has changed. If waitpid() returns because the status of a child
  process is available, and WNOWAIT was not specified in options, any pending
  SIGCHLD signal associated with the process ID of that child process is
  discarded. Any other pending SIGCHLD signals remain pending."

And interesting thing that it works if you add sleep(1) before waitpid(), and
also if you run with --verbose (some race or what).

But linux doesn't support WNOWAIT in waitpid() so add detection into
cmake/autotools.

Fixes: #387
Link: https://bugzilla.redhat.com/show_bug.cgi?id=840782
CMakeLists.txt
cmake/CheckWaitpidSupportWNOWAIT.cmake [new file with mode: 0644]
configure.ac
event-config.h.cmake
test/regress.c