Skip to content

Commit

Permalink
Fixed process death test in PHP code to match C code.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 31, 2008
1 parent 18748e3 commit 773ae24
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions offload.php
Expand Up @@ -299,15 +299,14 @@ function cachedMetadataMostRecent($metadata, $head)
// whoa, we were supposed to cache this!
if ($metadata['X-Offload-Caching-PID'] == getmypid())
return(false);
else if ($metadata['X-Offload-Caching-PID'] <= 0)
return(false);

// !!! FIXME: Linux specific!
if (is_dir('/proc'))
// !!! FIXME: Unix specific!
if (!posix_kill($metadata['X-Offload-Caching-PID'], 0))
{
if (!is_dir('/proc/' . $metadata['X-Offload-Caching-PID']))
{
debugEcho('Caching process ID died!');
return(false);
} // if
debugEcho('Caching process ID died!');
return(false);
} // if
} // if

Expand Down

0 comments on commit 773ae24

Please sign in to comment.