From d4f7b45c3fe483d3864534642f10cf8f6ee23ae9 Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Mon, 18 Sep 2017 18:14:37 +0200 Subject: Fix syncthing binary path detection. --- lib/xdsconfig/fileconfig.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/xdsconfig/fileconfig.go') diff --git a/lib/xdsconfig/fileconfig.go b/lib/xdsconfig/fileconfig.go index a0724af..2651caf 100644 --- a/lib/xdsconfig/fileconfig.go +++ b/lib/xdsconfig/fileconfig.go @@ -59,11 +59,12 @@ func readGlobalConfig(c *Config, confFile string) error { searchIn = append(searchIn, "/etc/xds-server/config.json") exePath := os.Args[0] - exeAbsPath, err := filepath.Abs(os.Args[0]) + ee, _ := os.Executable() + exeAbsPath, err := filepath.Abs(ee) if err == nil { exePath, err = filepath.EvalSymlinks(exeAbsPath) if err == nil { - exePath = filepath.Dir(exePath) + exePath = filepath.Dir(ee) } else { exePath = filepath.Dir(exeAbsPath) } -- cgit 1.2.3-korg