diff options
author | Amit Shah <amit.shah@redhat.com> | 2014-02-26 15:12:37 +0530 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2014-02-28 18:59:07 +0100 |
commit | 69bef7931e8880c709556f8444938d8bb9a16118 (patch) | |
tree | 5e623eb8c5c12ee554116427417e468dcc6b1729 /block.c | |
parent | 4b350f1de1685d7763b3b856eccdedbd691932b4 (diff) |
block: use /var/tmp instead of /tmp for -snapshot
If TMPDIR is not specified, the default was to use /tmp for the working
copy of the block devices. Update this to /var/tmp instead, so systems
using tmp-on-tmpfs don't end up inadvertently using RAM for the block
device.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -547,8 +547,9 @@ int get_tmp_filename(char *filename, int size) int fd; const char *tmpdir; tmpdir = getenv("TMPDIR"); - if (!tmpdir) - tmpdir = "/tmp"; + if (!tmpdir) { + tmpdir = "/var/tmp"; + } if (snprintf(filename, size, "%s/vl.XXXXXX", tmpdir) >= size) { return -EOVERFLOW; } |