From stdcxx-commits-return-897-apmail-incubator-stdcxx-commits-archive=incubator.apache.org@incubator.apache.org Wed Aug 16 18:49:50 2006 Return-Path: Delivered-To: apmail-incubator-stdcxx-commits-archive@www.apache.org Received: (qmail 1370 invoked from network); 16 Aug 2006 18:49:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Aug 2006 18:49:49 -0000 Received: (qmail 52364 invoked by uid 500); 16 Aug 2006 18:49:49 -0000 Delivered-To: apmail-incubator-stdcxx-commits-archive@incubator.apache.org Received: (qmail 52347 invoked by uid 500); 16 Aug 2006 18:49:49 -0000 Mailing-List: contact stdcxx-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-commits@incubator.apache.org Received: (qmail 52334 invoked by uid 99); 16 Aug 2006 18:49:49 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Aug 2006 11:49:49 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Aug 2006 11:49:48 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id AAAF41A981A; Wed, 16 Aug 2006 11:49:28 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r431989 - /incubator/stdcxx/trunk/util/memchk.cpp Date: Wed, 16 Aug 2006 18:49:28 -0000 To: stdcxx-commits@incubator.apache.org From: sebor@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060816184928.AAAF41A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: sebor Date: Wed Aug 16 11:49:28 2006 New Revision: 431989 URL: http://svn.apache.org/viewvc?rev=431989&view=rev Log: 2006-08-16 Farid Zaripov * memchk.cpp [_WIN32] (memchk): Or'ed _O_TEMPORARY with O_CREAT before passing the whole thing to Win32 open() and handled error return. Modified: incubator/stdcxx/trunk/util/memchk.cpp Modified: incubator/stdcxx/trunk/util/memchk.cpp URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/memchk.cpp?rev=431989&r1=431988&r2=431989&view=diff ============================================================================== --- incubator/stdcxx/trunk/util/memchk.cpp (original) +++ incubator/stdcxx/trunk/util/memchk.cpp Wed Aug 16 11:49:28 2006 @@ -2,20 +2,27 @@ * * memchk.cpp - definitions of memory checking helper functions * - * $Id: //stdlib/dev/source/stdlib/util/memchk.cpp#5 $ + * $Id$ * *************************************************************************** * - * Copyright (c) 1994-2005 Quovadx, Inc., acting through its Rogue Wave - * Software division. Licensed under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0. Unless required by - * applicable law or agreed to in writing, software distributed under - * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License - * for the specific language governing permissions and limitations under - * the License. + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. See the License for the specific language governing + * permissions and limitations under the License. + * + * Copyright 2001-2006 Rogue Wave Software. * **************************************************************************/ @@ -107,10 +114,15 @@ // create a temporary file and have Win32 delete it when // the last file descriptor that refers to it is closed - fd = open (fname, O_RDWR | _O_TEMPORARY, 0666); + fd = open (fname, O_RDWR | O_CREAT | _O_TEMPORARY, 0666); // free storage allocated by tempnam() free (fname); + + if (fd < 0) { + // error: unable to check addr + return size_t (-1); + } #else // !_WIN{32,64}