From 2b1a0643aa82b1d1654e3e1b41aef21b69615873 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Sat, 17 Mar 2018 19:51:54 +0100 Subject: [PATCH] mxrouter: Fix config file read errors A value in $_ (errno) is not an indication for a file read error. Check return value of "do" for undef. --- mxrouter/mxrouterctl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mxrouter/mxrouterctl b/mxrouter/mxrouterctl index 3c43140..93263e0 100755 --- a/mxrouter/mxrouterctl +++ b/mxrouter/mxrouterctl @@ -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)=@_;