From 6d8b80d6a7028236fb76df3038b08737a3ef9764 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Thu, 6 Oct 2016 10:17:12 +0200 Subject: Forker.pm: Add envset_append() method. --- lib/Arctica/Core/Mother/Forker.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/Arctica/Core/Mother/Forker.pm b/lib/Arctica/Core/Mother/Forker.pm index edb2acf..cc04619 100644 --- a/lib/Arctica/Core/Mother/Forker.pm +++ b/lib/Arctica/Core/Mother/Forker.pm @@ -406,6 +406,20 @@ sub log_slurper {# create pipe we can declare as log file. } } +sub envset_append { + my $self = $_[0]; + my $new_envvar_identifier = $_[1]; + my $new_envvar_value = $_[2]; + unless ( ($new_envvar_identifier =~ /^\s*$/) and ($new_envvar_value =~ /^\s*$/) ) { + unless (($self->{'dead'} eq 1) and ($self->{'child_pid'} > 0)) { + $self->{'env_set'}->{$new_envvar_identifier} = $new_envvar_value; + } else { + die("Mother::Forker Must append environment variable before exec!"); + } + } +} + + sub clargv_append { my $self = $_[0]; my $new_clargv = $_[1]; -- cgit v1.2.3