util, GetRuntimeDir: don't error out early if XDG_RUNTIME_DIR is not found
We must try out all possible alternatives for rootless users instead of
failing eary if XDG_RUNTIME_DIR is not set.
Following regression was part of: 5948e6b369
[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]
Signed-off-by: Aditya R <arajan@redhat.com>
This commit is contained in:
parent
4c7ae632c9
commit
aa2831dc24
|
|
@ -34,8 +34,7 @@ func GetRuntimeDir() (string, error) {
|
||||||
rootlessRuntimeDirOnce.Do(func() {
|
rootlessRuntimeDirOnce.Do(func() {
|
||||||
runtimeDir, err := homedir.GetRuntimeDir()
|
runtimeDir, err := homedir.GetRuntimeDir()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
rootlessRuntimeDirError = err
|
logrus.Debug(err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
if runtimeDir != "" {
|
if runtimeDir != "" {
|
||||||
st, err := os.Stat(runtimeDir)
|
st, err := os.Stat(runtimeDir)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue