mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
main: improve XDG_RUNTIME_DIR handling
1. Variable xdgRuntimeDir is only checked to be non-empty. Change it to a boolean. 2. Refactor so that os.Getenv is not called twice. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -52,9 +52,6 @@ func shouldUseRootlessCgroupManager(context *cli.Context) (bool, error) {
|
||||
}
|
||||
|
||||
func shouldHonorXDGRuntimeDir() bool {
|
||||
if os.Getenv("XDG_RUNTIME_DIR") == "" {
|
||||
return false
|
||||
}
|
||||
if os.Geteuid() != 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user