2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

configDB: minor bugfixing, code cleanup

git-svn-id: https://svn.fhem.de/fhem/trunk@7884 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2015-02-05 16:22:02 +00:00
parent 80ace0c35f
commit f788078b87
2 changed files with 6 additions and 7 deletions

View File

@ -35,7 +35,7 @@ sub CommandConfigdb($$) {
given ($cmd) { given ($cmd) {
when ('attr') { when ('attr') {
Log3('configdb', 4, 'configdb: attr $param1 $param2 requested.'); Log3('configdb', 4, "configdb: attr $param1 $param2 requested.");
if ($param1 eq "" && $param2 eq "") { if ($param1 eq "" && $param2 eq "") {
# list attributes # list attributes
foreach my $c (sort keys %{$configDB{attr}}) { foreach my $c (sort keys %{$configDB{attr}}) {

View File

@ -982,17 +982,16 @@ sub _cfgDB_Fileexport($;$) {
$sth->execute(); $sth->execute();
my $blobContent = $sth->fetchrow_array(); my $blobContent = $sth->fetchrow_array();
my $counter = length($blobContent); my $counter = length($blobContent);
$sth->finish();
$fhem_dbh->disconnect();
return "No data found for file $filename" unless $counter; return "No data found for file $filename" unless $counter;
return ($blobContent,$counter) if $raw;
open( FILE,">$filename" ); open( FILE,">$filename" );
binmode(FILE); binmode(FILE);
print FILE $blobContent; print FILE $blobContent;
close( FILE ); close( FILE );
return "$counter bytes written from database into file $filename";
$sth->finish();
$fhem_dbh->disconnect();
return "$counter bytes written from database into file $filename" unless $raw;
return ($blobContent,$counter);
} }
# import file into database # import file into database