X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fxdsconfig%2Ffileconfig.go;h=2651cafed91912fec76c36bf128508b2eef89bc2;hb=d4f7b45c3fe483d3864534642f10cf8f6ee23ae9;hp=a0724af91df63e9259d097fa07a3f64d1939c0a9;hpb=d007a7512af1f6c9b9ab9a238b47f1ebfc9f4dc8;p=src%2Fxds%2Fxds-server.git 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) }