From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JR4Dp-0005Gc-J0 for qemu-devel@nongnu.org; Mon, 18 Feb 2008 06:31:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JR4Do-0005Ff-Hl for qemu-devel@nongnu.org; Mon, 18 Feb 2008 06:31:44 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JR4Do-0005FX-8Q for qemu-devel@nongnu.org; Mon, 18 Feb 2008 06:31:44 -0500 Received: from hall.aurel32.net ([88.191.38.19]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JR4Dk-00035m-LJ for qemu-devel@nongnu.org; Mon, 18 Feb 2008 06:31:43 -0500 Received: from anguille.univ-lyon1.fr ([134.214.4.207]) by hall.aurel32.net with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JR4De-0000DF-II for qemu-devel@nongnu.org; Mon, 18 Feb 2008 12:31:34 +0100 Message-ID: <47B96C91.3090401@aurel32.net> Date: Mon, 18 Feb 2008 12:31:29 +0100 From: Aurelien Jarno MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Honor TMPDIR environment variable References: <20080128192742.GA19114@volta.aurel32.net> In-Reply-To: <20080128192742.GA19114@volta.aurel32.net> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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