diff options
Diffstat (limited to 'frontends/php/include/db.inc.php')
| -rw-r--r-- | frontends/php/include/db.inc.php | 17 |
1 files changed, 17 insertions, 0 deletions
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; } |
