libnetwork/osl: use filepath.Join() only when changing basedir
Use filepath.Join() only when the base-path is updated, instead of every time it is accessed. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
a9e8110fe3
commit
48ea7ec970
1 changed files with 3 additions and 3 deletions
|
@ -43,16 +43,16 @@ var (
|
|||
gpmWg sync.WaitGroup
|
||||
gpmCleanupPeriod = 60 * time.Second
|
||||
gpmChan = make(chan chan struct{})
|
||||
prefix = defaultPrefix
|
||||
netnsBasePath = filepath.Join(defaultPrefix, "netns")
|
||||
)
|
||||
|
||||
// SetBasePath sets the base url prefix for the ns path
|
||||
func SetBasePath(path string) {
|
||||
prefix = path
|
||||
netnsBasePath = filepath.Join(path, "netns")
|
||||
}
|
||||
|
||||
func basePath() string {
|
||||
return filepath.Join(prefix, "netns")
|
||||
return netnsBasePath
|
||||
}
|
||||
|
||||
func createBasePath() {
|
||||
|
|
Loading…
Add table
Reference in a new issue