From db59fed44d8a1df5b5feffbfb1fc7f3c9b61a8c1 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Thu, 28 Apr 2016 12:47:57 +0000 Subject: config: fix ReadConfigfileServe() not to loop endlessly Signed-off-by: ISHIDA Wataru --- config/serve.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'config/serve.go') diff --git a/config/serve.go b/config/serve.go index 6f49d0da..70a4e896 100644 --- a/config/serve.go +++ b/config/serve.go @@ -44,19 +44,18 @@ func ReadConfigfileServe(path, format string, configCh chan *BgpConfigSet) { } cnt++ configCh <- c - select { - case <-sigCh: - log.Info("reload the config file") - } - continue + goto NEXT ERROR: if cnt == 0 { log.Fatal("can't read config file ", path, ", ", err) } else { log.Warning("can't read config file ", path, ", ", err) - continue } - + NEXT: + select { + case <-sigCh: + log.Info("reload the config file") + } } } -- cgit v1.2.3