aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Iurt
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-25 23:29:33 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-25 23:29:33 +0000
commit681eca4d4baff8969b2f1983a463533765589e95 (patch)
tree00982fe9b256c867e4f33827b58a8e8d701595e4 /lib/Iurt
parent83ba1628366678395bed98773f00381b806cec75 (diff)
downloadiurt-681eca4d4baff8969b2f1983a463533765589e95.tar
iurt-681eca4d4baff8969b2f1983a463533765589e95.tar.gz
iurt-681eca4d4baff8969b2f1983a463533765589e95.tar.bz2
iurt-681eca4d4baff8969b2f1983a463533765589e95.tar.xz
iurt-681eca4d4baff8969b2f1983a463533765589e95.zip
(check_pid) simplify using MDK::Common
Diffstat (limited to 'lib/Iurt')
-rw-r--r--lib/Iurt/Process.pm9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/Iurt/Process.pm b/lib/Iurt/Process.pm
index b7b2f5e..310647f 100644
--- a/lib/Iurt/Process.pm
+++ b/lib/Iurt/Process.pm
@@ -43,9 +43,7 @@ sub check_pid {
if (-f $pidfile) {
my (@stat) = stat $pidfile;
- open(my $test_PID, $pidfile);
- my $pid = <$test_PID>;
- close $test_PID;
+ my $pid = cat_($pidfile);
if (!$pid) {
plog('ERROR', "ERROR: invalid pidfile ($pid), should be <pid>");
@@ -78,11 +76,8 @@ sub check_pid {
}
}
- open my $PID, ">$pidfile"
- or die "FATAL: can't open pidfile $pidfile for writing";
+ output($pidfile, $$);
- print $PID $$;
- close $PID;
$pidfile;
}