From 1d840e14b7f2658033d9c8dd4343418a2e44e700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sat, 17 Aug 2013 20:44:52 +0200 Subject: [PATCH 3/4] Cache the libc library search in parent process (for unshare). --- pym/portage/process.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pym/portage/process.py b/pym/portage/process.py index 512c324..0cebba7 100644 --- a/pym/portage/process.py +++ b/pym/portage/process.py @@ -279,6 +279,12 @@ def spawn(mycommand, env={}, opt_name=None, fd_pipes=None, returnpid=False, fd_pipes[1] = pw fd_pipes[2] = pw + # This caches the libc library lookup in the current + # process, so that it's only done once rather than + # for each child process. + if unshare_net: + find_library("c") + parent_pid = os.getpid() pid = None try: -- 1.8.3.2