summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-08-07 07:29:39 +0000
committerThierry Vignaud <tv@mandriva.org>2008-08-07 07:29:39 +0000
commit35c675b30863bce60eaa0bffcb2725d3c52e7ab0 (patch)
tree498357384436a05e22346ca3e5cae16c7d326ce7 /perl-install
parentec7b4cc292c32a50422f4af83041c6cc0e6f0613 (diff)
downloaddrakx-35c675b30863bce60eaa0bffcb2725d3c52e7ab0.tar
drakx-35c675b30863bce60eaa0bffcb2725d3c52e7ab0.tar.gz
drakx-35c675b30863bce60eaa0bffcb2725d3c52e7ab0.tar.bz2
drakx-35c675b30863bce60eaa0bffcb2725d3c52e7ab0.tar.xz
drakx-35c675b30863bce60eaa0bffcb2725d3c52e7ab0.zip
(is_running) make it return the actual PID of the first found process rather than a boolean
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/common.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 2924c4cb7..2234c0e91 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -303,10 +303,10 @@ sub set_permissions {
sub is_running {
my ($name, $o_user) = @_;
my $user = $o_user || $ENV{USER};
- any {
+ foreach (`ps -o '%P %p %c' -u $user`) {
my ($ppid, $pid, $n) = /^\s*(\d+)\s+(\d+)\s+(.*)/;
- $ppid != 1 && $pid != $$ && $n eq $name;
- } `ps -o '%P %p %c' -u $user`;
+ return $pid if $ppid != 1 && $pid != $$ && $n eq $name;
+ }
}
sub parse_release_file {