From 196926208788f38d8ca9813860f59bf2c4a33d2e Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Sat, 23 Feb 2008 12:04:39 +0000 Subject: [PATCH] trap inconsistency errors from log --- web/briskin5/Obj/briskin5.phh | 2 +- web/briskin5/index_wr.php | 9 ++++++++- web/index_wr.php | 7 ++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/web/briskin5/Obj/briskin5.phh b/web/briskin5/Obj/briskin5.phh index 2767c4e..11c7df3 100644 --- a/web/briskin5/Obj/briskin5.phh +++ b/web/briskin5/Obj/briskin5.phh @@ -437,7 +437,7 @@ function locshm_exists($tok) { // return (TRUE); - if (($id = shmop_open($tok,"a", 0, 0)) == FALSE) { + if (($id = @shmop_open($tok,"a", 0, 0)) == FALSE) { log_main($tok." SHM NOT exists"); return (FALSE); diff --git a/web/briskin5/index_wr.php b/web/briskin5/index_wr.php index 9f070f9..381b3ff 100644 --- a/web/briskin5/index_wr.php +++ b/web/briskin5/index_wr.php @@ -40,7 +40,14 @@ if ($table_idx < 0 || $table_idx >= TABLE_N) exit; $sem = Briskin5::lock_data($table_idx); -$bri = &Briskin5::load_data($table_idx,$table_token); + +if (($bri = &Briskin5::load_data($table_idx,$table_token)) == FALSE) { + echo "Bin5 Load data error"; + log_wr("Bin5 Load data error"); + Briskin5::unlock_data($sem); + exit; +} + if (($user = &$bri->get_user($sess, &$idx)) == FALSE) { echo "Get User Error"; log_wr("Get User Error"); diff --git a/web/index_wr.php b/web/index_wr.php index 57142d6..3e2c027 100644 --- a/web/index_wr.php +++ b/web/index_wr.php @@ -39,7 +39,12 @@ $is_spawn = FALSE; log_wr('COMM: '.$mesg); $sem = Room::lock_data(); -$room = &Room::load_data(); +if (($room = &Room::load_data()) == FALSE) { + echo "Load data error"; + log_wr("Load data error"); + Room::unlock_data($sem); + exit; +} if (($user = &$room->get_user($sess, &$idx)) == FALSE) { echo "Get User Error"; log_wr("Get User Error"); -- 2.17.1