You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stdcxx.apache.org by se...@apache.org on 2006/08/16 20:49:28 UTC

svn commit: r431989 - /incubator/stdcxx/trunk/util/memchk.cpp

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  <fa...@kyiv.vdiweb.com>

	* 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}