From c11a6fccfe76152f1bf0e26bbe2af3cf81d91c34 Mon Sep 17 00:00:00 2001 From: TheTroll Date: Fri, 26 Feb 2010 16:40:40 +0100 Subject: Added more check when opening a file --- includes/include.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'includes/include.php') diff --git a/includes/include.php b/includes/include.php index 1678b6d..5324609 100755 --- a/includes/include.php +++ b/includes/include.php @@ -20,13 +20,16 @@ function selectpage() $subcmd = ""; // Get segmenter PID - $pidfile = fopen('ram/streamsegmenterpid', 'r'); - if ($pidfile) + if (file_exists("ram/streamsegmenterpid")) { - $pid = fgets($pidfile); - $pid = substr($pid, 0, -1); - $subcmd = "kill " .$pid ." ; "; - fclose($pidfile); + $pidfile = fopen('ram/streamsegmenterpid', 'r'); + if ($pidfile) + { + $pid = fgets($pidfile); + $pid = substr($pid, 0, -1); + $subcmd = "kill " .$pid ." ; "; + fclose($pidfile); + } } $cmd= $subcmd ."rm ram/stream*"; -- cgit v1.2.3