Skip site navigation (1) Skip section navigation (2)

Re: win32 open patch for held unlink

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Claudio Natoli" <claudio(dot)natoli(at)memetrics(dot)com>
Cc: <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: win32 open patch for held unlink
Date: 2004-03-16 08:41:45
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers-win32
I think it looks good, and see no reason why it shouldn't work.

But I do think you should handle permission denied errors a bit more
gracefully, don't you think? Not exactly an uncommon error, and it would
certainly help to get the correct errno set there so you get a decent
error msg back in the caller.
Probably also ERROR_PATH_NOT_FOUND. The rest can be "generalised" into
one, since they don't occur very often.

Also (not sure about this one - so correct me if I'm wrong), shouldn't
errno be set to *something* upon error when you haven't set a specific
error? You return -1, but with errno="no error"? That will give you the
infamous "The error retuern was: The operation complete successfully"
that I see all the time on WIndows boxen. (That I see it in other apps
deos *not* mean we should emit it from postgresql :))

One other question: The _open_osfhandle docs don't really tell about how
to *close* the handle. Have you verified that you don't need to create a
separate close functino that will do CloseHandle() as well on it? Or do
we know that the system will do that for us when we close it? (I see
some google refs to _close() calling CloseHandle(), but no official
docs. THere are also docs saying that you *must* call closesocket() if
the handle is a socket, which would indicate the opposite... Should be
tested if not already done?)


> -----Original Message-----
> From: Claudio Natoli [mailto:claudio(dot)natoli(at)memetrics(dot)com] 
> Sent: Tuesday, March 16, 2004 4:02 AM
> To: 'pgsql-patches(at)postgresql(dot)org'
> Cc: pgsql-hackers-win32(at)postgresql(dot)org
> Subject: [pgsql-hackers-win32] win32 open patch for held unlink
> For application to HEAD, following community review. [open.c 
> destined for src/port]
> Win32 people: This has been kicked around on the thread for a 
> bit, I've not been able to break it, but am still 
> uncomfortable that it appears a novel solution. If you can 
> see any reason why this approach should not be adopted, speak 
> up now (or forever hold your transactions?).
> heers,
> Claudio
> --- 
> Certain disclaimers and policies apply to all email sent from 
> Memetrics. For the full text of these disclaimers and policies see 
> <a 
> href="">
> ailpolicy.html</a>

pgsql-hackers-win32 by date

Next:From: Claudio NatoliDate: 2004-03-16 09:22:25
Subject: Re: win32 open patch for held unlink
Previous:From: Claudio NatoliDate: 2004-03-16 04:22:39
Subject: Re: win32 open patch for held unlink

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group