From dev-return-5729-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Wed Feb 13 00:22:25 2002 Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 37258 invoked by uid 500); 13 Feb 2002 00:22:25 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 37242 invoked from network); 13 Feb 2002 00:22:24 -0000 Message-ID: <02f901c1b424$5d2ae880$94c0b0d0@v505> From: "William A. Rowe, Jr." To: =?UTF-8?Q?Branko_=C4=8Cibej?= , References: <20020212000734.63854.qmail@icarus.apache.org> <3C696AA0.5020502@xbc.nu> Subject: Re: cvs commit: apr/file_io/win32 open.c Date: Tue, 12 Feb 2002 18:15:23 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-OriginalArrivalTime: 13 Feb 2002 00:21:21.0800 (UTC) FILETIME=[5D2AE880:01C1B424] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > >wrowe 02/02/11 16:07:34 > > > > Modified: file_io/win32 open.c > > Log: > > I don't trust that the OS is even returning an error - if the handle > > is an invalid handle - I'm not certain that's an error. Certainly > > this code is safer - merits pushing into .32 > > if (file_handle == INVALID_HANDLE_VALUE) > > - return apr_get_os_error(); > > + return APR_EINVAL; > > From MSDN: > > Return Values > If the function succeeds, the return value is a handle to the > specified device. > > If the function fails, the return value is the INVALID_HANDLE_VALUE > flag. To get extended error information, call GetLastError. That would be fine if we were matching to INVALID_HANDLE_VALUE. We are discovering NULL rather than (DWORD)-1. This patch is not yet complete, at that, since we aren't testing for the NULL case. I'll be fixing in a moment. Bill