From d1937540f4e81c9915c90dc3ea488de042e59245 Mon Sep 17 00:00:00 2001 From: w00t Date: Thu, 20 Aug 2009 15:55:32 +0000 Subject: Allow relative and absolute paths to work (without magic) with pidfile. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11535 e03df62e-2008-0410-955e-edbf42e46eb7 --- .inspircd.inc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.inspircd.inc b/.inspircd.inc index f419d4b8a..6181d66ec 100644 --- a/.inspircd.inc +++ b/.inspircd.inc @@ -316,10 +316,23 @@ sub getpidfile { # Set the PID file and return. $pidfile = $1; + if (-f $pidfile) + { + return; + } + else + { + if (-f $confpath . $pidfile) + { + $pidfile = $confpath . $pidfile; + return; + } + } return; } } + # If we get here, NO PID FILE! -- Check for includes for my $i (@lines) { $i =~ s/[^=]+=\s(.*)/\1/; @@ -328,6 +341,18 @@ sub getpidfile # Decend into that file, and check for PIDs.. (that sounds like an STD ;/) getpidfile($1); # Was a PID found? + if (-f $pidfile) + { + return; + } + else + { + if (-f $confpath . $pidfile) + { + $pidfile = $confpath . $pidfile; + return; + } + } if ($pidfile ne "") { # Yes, Return. return; -- cgit v1.3.1-10-gc9f91