Commit 8edc80f2 authored by Frank's avatar Frank

cmake: fix fragile code related to HAVE_FORK macro

* report from Richard Newton indicated previous solutions was not
  working on Windows
parent 59b20e7f
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment