Return-Path: Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: (qmail 71160 invoked from network); 21 Oct 2008 16:09:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Oct 2008 16:09:30 -0000 Received: (qmail 33696 invoked by uid 500); 21 Oct 2008 16:09:32 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 33674 invoked by uid 500); 21 Oct 2008 16:09:32 -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 33663 invoked by uid 99); 21 Oct 2008 16:09:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Oct 2008 09:09:32 -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: local policy) Received: from [208.30.140.160] (HELO moroha.roguewave.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Oct 2008 16:08:23 +0000 Received: from exchmail01.Blue.Roguewave.Com (exchmail01.blue.roguewave.com [10.22.129.22]) by moroha.roguewave.com (8.13.6/8.13.6) with ESMTP id m9LG8oFw001263 for ; Tue, 21 Oct 2008 16:08:55 GMT X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH] STDCXX-401 test suite should honor TMPDIR Date: Tue, 21 Oct 2008 10:08:08 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] STDCXX-401 test suite should honor TMPDIR Thread-Index: AckzOafjs4uy/XYITcu0gjn4B4h3BAAXWo1Q References: <48FD613C.1000608@gmail.com> From: "Scott Zhong" To: X-Virus-Checked: Checked by ClamAV on apache.org I think I'll use this email scottyuzhong@gmail.com > -----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 >=20 > Scott Zhong wrote: > > Changelog: > > > > * tests/src/file.cpp (rw_tmpnam): use TMPDIR variable from environment > > if defined. >=20 > Okay, thanks. Patch committed here: > http://svn.apache.org/viewvc?rev=3D706515&view=3Drev >=20 > 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. >=20 > Martin >=20 > > > > here is the patch: > > > > Index: tests/src/file.cpp > > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --- 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 =3D getenv ("TMPDIR"); > > + if (tmpdir =3D=3D NULL) { > > + tmpdir =3D P_tmpdir; > > + } > > + > > if (!buf) { > > - static char fname_buf [sizeof (P_tmpdir) + sizeof > > (TMP_TEMPLATE)]; > > + static char fname_buf [PATH_MAX]; > > > > buf =3D fname_buf; > > *buf =3D '\0'; > > @@ -217,13 +222,13 @@ > > > > if ('\0' =3D=3D *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 =3D sizeof (P_tmpdir) - 1; > > + size_t len =3D strlen (tmpdir) - 1; > > > > - memcpy (buf, P_tmpdir, len); > > + memcpy (buf, tmpdir, len); > > if (_RWSTD_PATH_SEP !=3D buf [len - 1]) > > buf [len++] =3D _RWSTD_PATH_SEP; > > > > @@ -251,7 +256,7 @@ > > # ifdef _WIN32 > > > > // create a temporary file name > > - char* fname =3D tempnam (P_tmpdir, ".rwtest-tmp"); > > + char* fname =3D 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 > >