summaryrefslogtreecommitdiff
path: root/includes/include.php
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-02-26 16:40:40 +0100
committerTheTroll <trolldev@gmail.com>2010-02-26 16:40:40 +0100
commitc11a6fccfe76152f1bf0e26bbe2af3cf81d91c34 (patch)
treeb398a6e418e8e9f74e2e901f417a4e92bdf71989 /includes/include.php
parentd85aa30e9aa6ef1f1f42fb4af54364f6884cfa3a (diff)
downloadistreamdev-c11a6fccfe76152f1bf0e26bbe2af3cf81d91c34.tar.gz
istreamdev-c11a6fccfe76152f1bf0e26bbe2af3cf81d91c34.tar.bz2
Added more check when opening a file
Diffstat (limited to 'includes/include.php')
-rwxr-xr-xincludes/include.php15
1 files changed, 9 insertions, 6 deletions
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*";