From: Colin M. <mi...@us...> - 2005-09-08 17:14:32
|
Update of /cvsroot/battletorrent/bmachine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14914 Modified Files: seeder.php Log Message: - tweaked order of pythons in findPython - default to user-specified first - fgets - needed to specify size parameter (was causing error in older PHP versions) - block error messages for posix_kill Index: seeder.php =================================================================== RCS file: /cvsroot/battletorrent/bmachine/seeder.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** seeder.php 31 Aug 2005 17:54:11 -0000 1.22 --- seeder.php 8 Sep 2005 17:14:22 -0000 1.23 *************** *** 165,177 **** global $store; global $settings; ! ! // ! // if we've already figured out what we're sharing and saved it to our settings, then ! // just return that value ! // ! if (strlen($settings["sharing_actual_python"])) { ! return $settings["sharing_actual_python"]; ! } ! if (isset($settings["sharing_python"]) && strlen($settings["sharing_python"])) { --- 165,169 ---- global $store; global $settings; ! if (isset($settings["sharing_python"]) && strlen($settings["sharing_python"])) { *************** *** 185,188 **** --- 177,187 ---- } + // + // if we've already figured out what we're sharing and saved it to our settings, then + // just return that value + // + if (strlen($settings["sharing_actual_python"])) { + return $settings["sharing_actual_python"]; + } // *************** *** 426,430 **** flock($fp,LOCK_EX); ! while ($line = fgets($fp)) { $key = preg_replace("/^\s*(.*?)\s*?:.*/s",'\\1',$line); $value = preg_replace("/^.*:\s*(.*)\s*$/s",'\\1',$line); --- 425,429 ---- flock($fp,LOCK_EX); ! while ($line = fgets($fp, 4096)) { $key = preg_replace("/^\s*(.*?)\s*?:.*/s",'\\1',$line); $value = preg_replace("/^.*:\s*(.*)\s*$/s",'\\1',$line); *************** *** 474,480 **** while ( $retries < 3 && is_process_running($pid) ) { if ( $pid > 0 ) { ! posix_kill($pid, 2); // SIGINT sleep(10); ! posix_kill($pid, 9); // SIGKILL } $retries++; --- 473,479 ---- while ( $retries < 3 && is_process_running($pid) ) { if ( $pid > 0 ) { ! @posix_kill($pid, 2); // SIGINT sleep(10); ! @posix_kill($pid, 9); // SIGKILL } $retries++; *************** *** 495,499 **** $pid = (integer)$pid; if ( $pid > 0 ) { ! posix_kill($pid,2); //SIGINT } } --- 494,498 ---- $pid = (integer)$pid; if ( $pid > 0 ) { ! @posix_kill($pid,2); //SIGINT } } *************** *** 504,508 **** $pid = (integer)$pid; if ( $pid > 0 ) { ! posix_kill($pid,9); //SIGKILL } } --- 503,507 ---- $pid = (integer)$pid; if ( $pid > 0 ) { ! @posix_kill($pid,9); //SIGKILL } } |