summaryrefslogtreecommitdiffstats
path: root/mdkonline.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2006-03-29 22:05:42 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2006-03-29 22:05:42 +0000
commit4e7a51a51e3444b9679fe619449745d04aabfaed (patch)
tree5ca7c7bf930098b071d6470fcf4ebd972d187532 /mdkonline.pm
parent94137bc44d73d38c10f039d35a4864f315161504 (diff)
downloadmgaonline-4e7a51a51e3444b9679fe619449745d04aabfaed.tar
mgaonline-4e7a51a51e3444b9679fe619449745d04aabfaed.tar.gz
mgaonline-4e7a51a51e3444b9679fe619449745d04aabfaed.tar.bz2
mgaonline-4e7a51a51e3444b9679fe619449745d04aabfaed.tar.xz
mgaonline-4e7a51a51e3444b9679fe619449745d04aabfaed.zip
(is_running) return the actual pid of the found program
Diffstat (limited to 'mdkonline.pm')
-rw-r--r--mdkonline.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/mdkonline.pm b/mdkonline.pm
index 09296d1b..6674a2e8 100644
--- a/mdkonline.pm
+++ b/mdkonline.pm
@@ -345,10 +345,15 @@ sub write_wide_conf {
sub is_running {
my ($name) = @_;
- any {
+ my $found;
+ foreach (`ps -o '%P %p %c' -u $ENV{USER}`) {
my ($_ppid, $pid, $n) = /^\s*(\d+)\s+(\d+)\s+(.*)/;
- $pid != $$ && $n eq $name;
- } `ps -o '%P %p %c' -u $ENV{USER}`;
+ if ($pid != $$ && $n eq $name) {
+ $found = $pid;
+ last;
+ }
+ }
+ $found;
}
# Romain: you need to finish those dns functions or drop them