aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2020-08-29 13:13:44 -0700
committerZac Medico <zmedico@gentoo.org>2020-08-30 23:25:05 -0700
commitcf07a23a0ff77049476e0f4b94afbb6a844806fa (patch)
treed9ba20d1cca5730427a4d7c3e855b934d986d92d /lib/portage/_emirrordist/FetchTask.py
parentdephgraph: Allow elimination of highest version after slot conflict (bug 439688) (diff)
downloadportage-cf07a23a0ff77049476e0f4b94afbb6a844806fa.tar.gz
portage-cf07a23a0ff77049476e0f4b94afbb6a844806fa.tar.bz2
portage-cf07a23a0ff77049476e0f4b94afbb6a844806fa.zip
Use cached portage.getpid() function (bug 739540)
Use the cached portage.getpid() function to avoid unnecessary syscalls, and update the cache after each call to os.fork() where the fork may invoke portage APIs. Bug: https://bugs.gentoo.org/739540 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/portage/_emirrordist/FetchTask.py')
-rw-r--r--lib/portage/_emirrordist/FetchTask.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/portage/_emirrordist/FetchTask.py b/lib/portage/_emirrordist/FetchTask.py
index 457ca2ac6..41f96b962 100644
--- a/lib/portage/_emirrordist/FetchTask.py
+++ b/lib/portage/_emirrordist/FetchTask.py
@@ -415,7 +415,7 @@ class FetchTask(CompositeTask):
self._fetch_tmp_dir_info = 'distfiles'
distdir = self.config.options.distfiles
- tmp_basename = self.distfile + '._emirrordist_fetch_.%s' % os.getpid()
+ tmp_basename = self.distfile + '._emirrordist_fetch_.%s' % portage.getpid()
variables = {
"DISTDIR": distdir,
@@ -622,7 +622,7 @@ class FetchTask(CompositeTask):
head, tail = os.path.split(dest)
hardlink_tmp = os.path.join(head, ".%s._mirrordist_hardlink_.%s" % \
- (tail, os.getpid()))
+ (tail, portage.getpid()))
try:
try: