diff options
author | Bruce Momjian <bruce@momjian.us> | 2004-08-29 00:38:03 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2004-08-29 00:38:03 +0000 |
commit | 704ff0b2f25b62cce26e573eafa96ed7e5b6f04e (patch) | |
tree | f67d1796e834215e0e699b25fdea2cec455a6d54 /src/backend/port/win32/shmem.c | |
parent | fe90fb4d3733550340651351d44efcae35402324 (diff) |
>>> I understand your disliking of non-posix stuff. OTOH,
>>GetLastError will
>>> give much more details than errno.
>>
>>How much more, really? That mapping table gave me the impression that
>>the win32 error codes aren't all that much more detailed than errno...
>
>The mapping table is not complete. My winerror.h from the SDK
>lists 2209
>error codes, whereas errno.h lists 42...
>
>I still don't think we'll get that much more stuff. Right now,
>the Win32
>code paths that actually use the more advanced functions already write
>out the error number in case something happens. We can keep doing that
>for the other paths (ereport the error *number* when the mapping does
>not have a match). The map to errno will catch almost all cases, I
>think. And in the corner cases we can do with just the number, and use
>"net helpmsg" to get the actual message when checking...
Here's an attempt on this. new file goes in backend/port/win32.
Magnus Hagander
Diffstat (limited to 'src/backend/port/win32/shmem.c')
-rw-r--r-- | src/backend/port/win32/shmem.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/port/win32/shmem.c b/src/backend/port/win32/shmem.c index 89bcadc8cdc..99e4b467e40 100644 --- a/src/backend/port/win32/shmem.c +++ b/src/backend/port/win32/shmem.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/port/win32/shmem.c,v 1.5 2004/04/19 17:42:58 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/port/win32/shmem.c,v 1.6 2004/08/29 00:38:03 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -40,7 +40,7 @@ shmat(int memId, void *shmaddr, int flag) if (lpmem == NULL) { lpmem = (void *) -1; - errno = GetLastError(); + _dosmaperr(GetLastError()); } return lpmem; @@ -123,6 +123,7 @@ shmget(int memKey, int size, int flag) else if (!hmap) { /* Unable to get shared memory */ + _dosmaperr(GetLastError()); return -1; } |