From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Honor TMPDIR environment variable
Date: Mon, 18 Feb 2008 12:31:29 +0100 [thread overview]
Message-ID: <47B96C91.3090401@aurel32.net> (raw)
In-Reply-To: <20080128192742.GA19114@volta.aurel32.net>
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
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
prev parent reply other threads:[~2008-02-18 11:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-28 19:27 [Qemu-devel] [PATCH] Honor TMPDIR environment variable Aurelien Jarno
2008-02-18 11:31 ` Aurelien Jarno [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47B96C91.3090401@aurel32.net \
--to=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).