mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-02 14:03:43 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user