From: janw Date: Wed, 1 Apr 2009 16:36:50 +0000 (+0000) Subject: Merge changes from gosa-lhm branch. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ae72fc890f7c15be68d2acbad95c6240d0931084;p=gosa.git Merge changes from gosa-lhm branch. Don't waste resources if statement list is empty. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13576 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/modules/DBsqlite.pm b/gosa-si/modules/DBsqlite.pm index ddb4c0d84..93aa51bab 100644 --- a/gosa-si/modules/DBsqlite.pm +++ b/gosa-si/modules/DBsqlite.pm @@ -44,7 +44,7 @@ sub lock { &main::daemon_log("0 ERROR: GOSA::DBsqlite::lock was called static! Statement was '$self'!", 1); return; } - if(not ref $self->{db_lock_handle}) { + if(not ref $self->{db_lock_handle} or not fileno $self->{db_lock_handle}) { sysopen($self->{db_lock_handle}, $self->{db_lock}, O_RDWR) or &main::daemon_log("0 ERROR: Opening the database ".$self->{db_name}." failed with $!", 1); } my $lock_result = flock($self->{db_lock_handle}, LOCK_EX); @@ -509,6 +509,9 @@ sub exec_statementlist { &main::daemon_log("0 ERROR: GOSA::DBsqlite::exec_statementlist was called static!", 1); return; } + + return undef if (ref($sql_list) ne 'ARRAY' or @{ $sql_list } == 0); + my @db_answer; foreach my $sql_statement (@$sql_list) {