aboutsummaryrefslogtreecommitdiff
path: root/lib/Arctica
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-10-06 10:17:12 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-10-06 10:17:12 +0200
commit6d8b80d6a7028236fb76df3038b08737a3ef9764 (patch)
tree18f0a35c10691de804719bcec1a141e6495fed75 /lib/Arctica
parent3cbda0ebc0cf5b418d47ef98dcc004dcc0bf985c (diff)
downloadperl-Arctica-Core-Mother-Forker-6d8b80d6a7028236fb76df3038b08737a3ef9764.tar.gz
perl-Arctica-Core-Mother-Forker-6d8b80d6a7028236fb76df3038b08737a3ef9764.tar.bz2
perl-Arctica-Core-Mother-Forker-6d8b80d6a7028236fb76df3038b08737a3ef9764.zip
Forker.pm: Add envset_append() method.
Diffstat (limited to 'lib/Arctica')
-rw-r--r--lib/Arctica/Core/Mother/Forker.pm14
1 files changed, 14 insertions, 0 deletions
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];