[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Honor TMPDIR environment variable
From: |
Aurelien Jarno |
Subject: |
Re: [Qemu-devel] [PATCH] Honor TMPDIR environment variable |
Date: |
Mon, 18 Feb 2008 12:31:29 +0100 |
User-agent: |
IceDove 1.5.0.14pre (X11/20080208) |
Any news about this patch?
Aurelien Jarno a écrit :
> The patch below adds support for the -snapshot option to use the TMPDIR
> environment variable.
>
> ---
> block.c | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/block.c b/block.c
> index 0f8ad7b..0730954 100644
> --- a/block.c
> +++ b/block.c
> @@ -191,8 +191,12 @@ void get_tmp_filename(char *filename, int size)
> void get_tmp_filename(char *filename, int size)
> {
> int fd;
> + char *tmpdir;
> /* XXX: race condition possible */
> - pstrcpy(filename, size, "/tmp/vl.XXXXXX");
> + tmpdir = getenv("TMPDIR");
> + if (!tmpdir)
> + tmpdir = "/tmp";
> + snprintf(filename, size, "%s/vl.XXXXXX", tmpdir);
> fd = mkstemp(filename);
> close(fd);
> }
>
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' address@hidden | address@hidden
`- people.debian.org/~aurel32 | www.aurel32.net
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH] Honor TMPDIR environment variable,
Aurelien Jarno <=