From d43cdad7158fb7bcf8d05da5030b4cb01397f784 Mon Sep 17 00:00:00 2001 From: osmiy Date: Tue, 19 Dec 2006 14:37:15 +0000 Subject: minor changes [compiled version] git-svn-id: svn://svn.zabbix.com/trunk@3612 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/db.inc.php | 17 +++++++++++++++++ frontends/php/include/forms.inc.php | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'frontends/php/include') diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php index 8f5953c4..89adc68c 100644 --- a/frontends/php/include/db.inc.php +++ b/frontends/php/include/db.inc.php @@ -90,7 +90,9 @@ global $ZBX_SEM_ID; if($ZBX_SEM_ID && function_exists('sem_acquire')) + { sem_acquire($ZBX_SEM_ID); + } } } @@ -105,6 +107,20 @@ } } + if(!function_exists('free_db_access')) + { + function free_db_access() + { + global $ZBX_SEM_ID; + + if($ZBX_SEM_ID && function_exists('sem_remove')) + sem_remove($ZBX_SEM_ID); + + $ZBX_SEM_ID = false; + } + } + + if(file_exists($DB_DATABASE)) { $DB = sqlite3_open($DB_DATABASE); @@ -146,6 +162,7 @@ case "SQLITE3": $result = true; sqlite3_close($DB); + free_db_access(); break; default: break; } diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php index 82955f50..65f8b6c8 100644 --- a/frontends/php/include/forms.inc.php +++ b/frontends/php/include/forms.inc.php @@ -2887,7 +2887,7 @@ new CButton('add_template',S_ADD, "return PopUp('popup.php?dstfrm=".$frmHost->GetName(). "&dstfld1=new_template&srctbl=templates&srcfld1=hostid&srcfld2=host". - url_param($templates,false,'existed_templates')."',450,450)l", + url_param($templates,false,'existed_templates')."',450,450)", 'T') )); -- cgit