aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-09 01:11:29 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-09 01:11:29 +0000
commit60c01aa7a4681fb39598d443eb1cb92b070b51a6 (patch)
tree5140e625de2e3e895538aa952d56f1fbbeca3697
parent1fbcf16bdc5b8c932ec74f753ea8aecd7c405c72 (diff)
downloadpaludis-60c01aa7a4681fb39598d443eb1cb92b070b51a6.tar.gz
paludis-60c01aa7a4681fb39598d443eb1cb92b070b51a6.tar.xz
Define PALUDIS_PID
-rw-r--r--paludis/util/system.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/paludis/util/system.cc b/paludis/util/system.cc
index fa46c7d..bd1d616 100644
--- a/paludis/util/system.cc
+++ b/paludis/util/system.cc
@@ -54,6 +54,14 @@ namespace
int
real_run_command(const std::string & cmd, const FSEntry * const fsentry)
{
+ static bool done_paludis_pid(false);
+ if (! done_paludis_pid)
+ {
+ if (getenv_with_default("PALUDIS_PID", "").empty())
+ setenv("PALUDIS_PID", stringify(getpid()).c_str(), 1);
+ done_paludis_pid = true;
+ }
+
pid_t child(fork());
if (0 == child)
{