Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 50046 invoked from network); 23 Oct 2008 03:35:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Oct 2008 03:35:33 -0000 Received: (qmail 22741 invoked by uid 500); 23 Oct 2008 03:35:36 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 22716 invoked by uid 500); 23 Oct 2008 03:35:36 -0000 Mailing-List: contact dev-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list dev@stdcxx.apache.org Received: (qmail 22704 invoked by uid 99); 23 Oct 2008 03:35:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Oct 2008 20:35:36 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of msebor@gmail.com designates 209.85.198.233 as permitted sender) Received: from [209.85.198.233] (HELO rv-out-0506.google.com) (209.85.198.233) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Oct 2008 03:34:25 +0000 Received: by rv-out-0506.google.com with SMTP id g37so144337rvb.23 for ; Wed, 22 Oct 2008 20:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=qV84oFjsafaq3VQk7Z+A1OGrC+4ib9zuQ7JWhhPhBDk=; b=e7TX13rusgRyvHdRZzKuaNrPjMd8hZz+7otRhI1AmriXPjSJjR0AUzH0Bufo4JVPrp ijmWaRMCuYLZGTNPx3XbzEpneTVFakGGh8WPy31f34Y0DBhIHA0P1toFdwSYXPTuBwDi nK5B7rfXRJR8heoGuTG2Yd8Zecwge/i95yKlQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=dMFXiSC/dwwhXsz34sDPFpMAtYxkbn38sasMig9HyVirkOoxsq1VKF4FKRY0O4t0TI V2p7w/5bo0xw8yk1/vfSJEYOyfJOEAh42bH0qsqtp/OrqXTAbbBsgiBy+nz5GCvZq2za +dNEp+00erqyLT4JdfEhYdZfrzsSgpaPqei4I= Received: by 10.141.206.13 with SMTP id i13mr28028rvq.211.1224732904241; Wed, 22 Oct 2008 20:35:04 -0700 (PDT) Received: from bugsy.net (c-71-229-200-170.hsd1.co.comcast.net [71.229.200.170]) by mx.google.com with ESMTPS id c20sm5990183rvf.3.2008.10.22.20.35.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 22 Oct 2008 20:35:02 -0700 (PDT) Message-ID: <48FFF0E4.60905@gmail.com> Date: Wed, 22 Oct 2008 21:35:00 -0600 From: Martin Sebor User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: dev@stdcxx.apache.org Subject: Re: [PATCH] STDCXX-401 test suite should honor TMPDIR References: <48FD613C.1000608@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Scott Zhong wrote: > I think I'll use this email scottyuzhong@gmail.com Okay, please check the new change log message: http://svn.apache.org/viewvc?view=rev&revision=706515 In the future, please include your email info in the log message. > >> -----Original Message----- >> From: Martin Sebor [mailto:msebor@gmail.com] >> Sent: Monday, October 20, 2008 10:58 PM >> To: dev@stdcxx.apache.org >> Subject: Re: [PATCH] STDCXX-401 test suite should honor TMPDIR >> >> Scott Zhong wrote: >>> Changelog: >>> >>> * tests/src/file.cpp (rw_tmpnam): use TMPDIR variable from > environment >>> if defined. >> Okay, thanks. Patch committed here: >> http://svn.apache.org/viewvc?rev=706515&view=rev >> >> FYI: I used your Rogue Wave email address to complete your change >> comment. If that's not what you want listed in the ChangeLog please >> provide an alternate address. >> >> Martin >> >>> here is the patch: >>> >>> Index: tests/src/file.cpp >>> =================================================================== >>> --- tests/src/file.cpp (revision 702657) >>> +++ tests/src/file.cpp (working copy) >>> @@ -208,8 +208,13 @@ >>> #ifndef _RWSTD_NO_MKSTEMP >>> # define TMP_TEMPLATE "tmpfile-XXXXXX" >>> >>> + const char *tmpdir = getenv ("TMPDIR"); >>> + if (tmpdir == NULL) { >>> + tmpdir = P_tmpdir; >>> + } >>> + >>> if (!buf) { >>> - static char fname_buf [sizeof (P_tmpdir) + sizeof >>> (TMP_TEMPLATE)]; >>> + static char fname_buf [PATH_MAX]; >>> >>> buf = fname_buf; >>> *buf = '\0'; >>> @@ -217,13 +222,13 @@ >>> >>> if ('\0' == *buf) { >>> // copy the template to the buffer; make sure there is > exactly >>> - // one path separator character between P_tmpdir and the > file >>> + // one path separator character between tmpdir and the file >>> // name template (it doesn't really matter how many there > are >>> // as long as it's at least one, but one looks better than > two >>> // in diagnostic messages) >>> - size_t len = sizeof (P_tmpdir) - 1; >>> + size_t len = strlen (tmpdir) - 1; >>> >>> - memcpy (buf, P_tmpdir, len); >>> + memcpy (buf, tmpdir, len); >>> if (_RWSTD_PATH_SEP != buf [len - 1]) >>> buf [len++] = _RWSTD_PATH_SEP; >>> >>> @@ -251,7 +256,7 @@ >>> # ifdef _WIN32 >>> >>> // create a temporary file name >>> - char* fname = tempnam (P_tmpdir, ".rwtest-tmp"); >>> + char* fname = tempnam (tmpdir, ".rwtest-tmp"); >>> >>> if (fname) { >>> >>> @@ -272,7 +277,7 @@ >>> else { >>> fprintf (stderr, "%s:%d: tempnam(\"%s\", \"%s\") failed: > %s\n", >>> __FILE__, __LINE__, >>> - P_tmpdir, ".rwtest-tmp", strerror (errno)); >>> + tmpdir, ".rwtest-tmp", strerror (errno)); >>> } >>> >>> # else >>> > >