From 25cb8c020e8f001bbba2a6fa1be7c4ca6161350d Mon Sep 17 00:00:00 2001
From: Konstantin Shulgin <konstantin.shulgin@gmail.com>
Date: Mon, 22 Aug 2011 18:40:07 +0400
Subject: [PATCH] feature 'master-valgrind':

Core:
  - fix telling libev about forks.
---
 core/fiber.m       | 1 +
 core/replication.m | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/core/fiber.m b/core/fiber.m
index 0d987b86b8..6a1d732010 100644
--- a/core/fiber.m
+++ b/core/fiber.m
@@ -1062,6 +1062,7 @@ spawn_child(const char *name, int inbox_size, struct tbuf *(*handler) (void *, s
 		/* it is safier to tell libev about fork, even
 		 * if child wont' use it. */
 		ev_default_fork();
+		ev_loop(EVLOOP_NONBLOCK);
 
 		char child_name[sizeof(fiber->name)];
 		/*
diff --git a/core/replication.m b/core/replication.m
index f0d1a47b91..693fa4b41c 100644
--- a/core/replication.m
+++ b/core/replication.m
@@ -186,6 +186,7 @@ replication_prefork()
 			panic("set_nonblock");
 	} else {
 		ev_default_fork();
+		ev_loop(EVLOOP_NONBLOCK);
 		/* child process: spawner */
 		close(sockpair[0]);
 		/*
@@ -453,6 +454,7 @@ spawner_create_replication_relay(int client_sock)
 
 	if (pid == 0) {
 		ev_default_fork();
+		ev_loop(EVLOOP_NONBLOCK);
 		close(spawner.sock);
 		replication_relay_loop(client_sock);
 	} else {
-- 
GitLab