Skip to content
Snippets Groups Projects
Commit a85d2dae authored by pharook's avatar pharook
Browse files

Upraveno cteni konfiguracnich souboru - odchyceny navraty 'do', zruseno...

Upraveno cteni konfiguracnich souboru - odchyceny navraty 'do', zruseno nadbytecne kontrolni cteni (#533)
parent 9de60ed1
No related branches found
No related tags found
No related merge requests found
...@@ -26,15 +26,11 @@ sub loadConf ...@@ -26,15 +26,11 @@ sub loadConf
our $SSL_CA_FILE = undef; our $SSL_CA_FILE = undef;
our $MAX_RCV_EVENTS_LIMIT = undef; our $MAX_RCV_EVENTS_LIMIT = undef;
# read config file
if ( ! open( TMP, $conf_file) ) {
die("Can't read config file '$conf_file': $!\n");
}
close TMP;
# load set variables by user # load set variables by user
if ( !do $conf_file ) { unless (do $conf_file) {
die("Errors in config file '$conf_file': $@"); die("Errors in config file '$conf_file': $@") if $@;
die("Can't read config file '$conf_file': $!") unless defined $_;
# if $_ defined, it's retvalue of last statement of conf, for which we don't care
} }
return ($URI, $SSL_KEY_FILE, $SSL_CERT_FILE, $SSL_CA_FILE, $MAX_RCV_EVENTS_LIMIT); return ($URI, $SSL_KEY_FILE, $SSL_CERT_FILE, $SSL_CA_FILE, $MAX_RCV_EVENTS_LIMIT);
......
...@@ -36,15 +36,11 @@ our $DB_HOST = undef; ...@@ -36,15 +36,11 @@ our $DB_HOST = undef;
our $MAX_EVENTS_LIMIT = undef; our $MAX_EVENTS_LIMIT = undef;
our %VALID_STRINGS = undef; our %VALID_STRINGS = undef;
# read config file
if (!open( TMP, $conf_file)) {
errMsg("Can't read config file '$conf_file': $!\n");
}
close TMP;
# load set variables by user # load set variables by user
if (!do $conf_file) { unless (do $conf_file) {
errMsg("Errors in config file '$conf_file': $@"); errMsg("Errors in config file '$conf_file': $@") if $@;
errMsg("Can't read config file '$conf_file': $!") unless defined $_;
# if $_ defined, it's retvalue of last statement of conf, for which we don't care
} }
......
...@@ -25,15 +25,11 @@ sub loadConf ...@@ -25,15 +25,11 @@ sub loadConf
our $SSL_CERT_FILE = undef; our $SSL_CERT_FILE = undef;
our $SSL_CA_FILE = undef; our $SSL_CA_FILE = undef;
# read config file
if ( ! open( TMP, $conf_file) ) {
die "Can't read config file '$conf_file': $!\n";
}
close TMP;
# load set variables by user # load set variables by user
if ( !do $conf_file ) { unless (do $conf_file) {
die("Errors in config file '$conf_file': $@"); die("Errors in config file '$conf_file': $@") if $@;
die("Can't read config file '$conf_file': $!") unless defined $_;
# if $_ defined, it's retvalue of last statement of conf, for which we don't care
} }
return ($URI, $SSL_KEY_FILE, $SSL_CERT_FILE, $SSL_CA_FILE); return ($URI, $SSL_KEY_FILE, $SSL_CERT_FILE, $SSL_CA_FILE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment