Commit 69bef793 authored by Amit Shah's avatar Amit Shah Committed by Stefan Hajnoczi
Browse files

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: default avatarAmit Shah <amit.shah@redhat.com>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent 4b350f1d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;
    }