cmake: fix fragile code related to HAVE_FORK macro

* report from Richard Newton indicated previous solutions was not
  working on Windows
This commit is contained in:
Frank 2014-03-18 21:04:52 +01:00
parent 59b20e7f3e
commit 8edc80f27b
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@
#cmakedefine ZMQ_FORCE_MUTEXES
#cmakedefine01 HAVE_FORK
#cmakedefine HAVE_FORK
#cmakedefine HAVE_CLOCK_GETTIME
#cmakedefine HAVE_GETHRTIME
#cmakedefine ZMQ_HAVE_UIO

View File

@ -104,7 +104,7 @@ zmq::fd_t zmq::signaler_t::get_fd ()
void zmq::signaler_t::send ()
{
#if HAVE_FORK
#if defined(HAVE_FORK)
if (unlikely(pid != getpid())) {
//printf("Child process %d signaler_t::send returning without sending #1\n", getpid());
return; // do not send anything in forked child context
@ -125,7 +125,7 @@ void zmq::signaler_t::send ()
ssize_t nbytes = ::send (w, &dummy, sizeof (dummy), 0);
if (unlikely (nbytes == -1 && errno == EINTR))
continue;
#if HAVE_FORK
#if defined(HAVE_FORK)
if (unlikely(pid != getpid())) {
//printf("Child process %d signaler_t::send returning without sending #2\n", getpid());
errno = EINTR;