Skip to content

Commit

Permalink
mxrouter: Fix config file read errors
Browse files Browse the repository at this point in the history
A value in $_ (errno) is not an indication for a file read error.

Check return value of "do" for undef.
  • Loading branch information
donald committed Mar 17, 2018
1 parent b071ee8 commit 2b1a064
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mxrouter/mxrouterctl
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,10 @@ unless (-e $CONFIG_FILE) {
exit;
}

do $CONFIG_FILE;
$@ and die "$CONFIG_FILE: $@\n";
$! and die "$CONFIG_FILE: $!\n";
unless (defined do "$CONFIG_FILE") {
die "$CONFIG_FILE: $@\n" if $@;
die "$CONFIG_FILE: $!\n";
}

sub dhcrelay_forward {
my ($ip)=@_;
Expand Down

0 comments on commit 2b1a064

Please sign in to comment.