projects
/
slony1-engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
902ef76
)
get_pid() will check to make sure the pid actually exists
author
Steve Singer
<ssinger@ca.afilias.info>
Thu, 8 Nov 2012 19:02:20 +0000
(14:02 -0500)
committer
Luiz K. Matsumura
<luiz.matsumura@gmail.com>
Thu, 8 Nov 2012 22:14:28 +0000
(20:14 -0200)
tools/altperl/slon-tools.pm
patch
|
blob
|
blame
|
history
diff --git
a/tools/altperl/slon-tools.pm
b/tools/altperl/slon-tools.pm
index 4072ccfd925f0473bf20ecf9b6ef98753b9731be..cde1663a4fbb712018b7c6d6d73c43c0040ce3e5 100644
(file)
--- a/
tools/altperl/slon-tools.pm
+++ b/
tools/altperl/slon-tools.pm
@@
-4,6
+4,7
@@
# Copyright 2004-2009 Afilias Canada
use POSIX;
+use Errno;
use File::Temp qw/ tempfile tempdir /;
sub add_node {
@@
-147,6
+148,12
@@
sub get_pid {
#print "Command:\n$command\n";
chomp $pid;
+ #make sure the pid actually exists
+ kill(0,$pid);
+ if ($! == Errno::ESRCH) {
+ return 0;
+ }
+
return $pid;
}