summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-03-06 07:39:32 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2020-03-06 10:21:37 -0500
commitcb51707f91e683323ba61fca49363a997ed1be1f (patch)
tree360c31e8e4d34083f02798cd51ad0ffc435f3b80 /pkg
parentf07e18f05c07026e4544788a1359122c81adcde7 (diff)
downloadpodman-cb51707f91e683323ba61fca49363a997ed1be1f.tar.gz
podman-cb51707f91e683323ba61fca49363a997ed1be1f.tar.bz2
podman-cb51707f91e683323ba61fca49363a997ed1be1f.zip
Allow users to set TMPDIR environment
Some users have small /var/tmp directories and need to be able to specify a different location for temporary files, which includes more space. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/util/utils.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/util/utils.go b/pkg/util/utils.go
index 4a52ea68d..a4df48c88 100644
--- a/pkg/util/utils.go
+++ b/pkg/util/utils.go
@@ -600,3 +600,12 @@ func HomeDir() (string, error) {
}
return home, nil
}
+
+func Tmpdir() string {
+ tmpdir := os.Getenv("TMPDIR")
+ if tmpdir == "" {
+ tmpdir = "/var/tmp"
+ }
+
+ return tmpdir
+}