Обсуждение: Re: REPOST: InitDB Failure on install

Поиск
Список
Период
Сортировка

Re: REPOST: InitDB Failure on install

От
"Magnus Hagander"
Дата:
>>> In XP pro, it's working fine. But not int w2k server.
><snip>
>
>creating template1 database in F:/PostgreSQL/data/base/1 ...
>WARNING:  could
>not find a match for Windows timezone "Hora oficial do Brasil"
>FATAL:  could not create shared memory segment: No error
>DETAIL:  Failed system call was shmget(key=1, size=1196032, 03600).
>child process was terminated by signal 1
>
>
>>Magnus Hagander, who (mostly) wrote both the binary installer and the
>>new time zone code, is on vacation.  Most everybody else is busy right
>>now with the beta so things are a bit slower than usual.
>
>This is not an issue with the timezone code, this is an issue
>with the shmem code. It is clearly not reporting error
>messages correctly. I'll see if I can look into this soon and
>get back to you.
>
>Rodrigo - do you have an environment set up so you can compile
>the source code? For testing possible patches...


Ok, that was quicker than I thought :-)
Can you, or someone else who can reproduce this problem, please try this
patch and see if the error message changes to tell us what's actually
wrong.



Index: backend/port/win32/shmem.c
===================================================================
RCS file:
/projects/cvsroot/pgsql-server/src/backend/port/win32/shmem.c,v
retrieving revision 1.5
diff -c -r1.5 shmem.c
*** backend/port/win32/shmem.c  19 Apr 2004 17:42:58 -0000      1.5
--- backend/port/win32/shmem.c  15 Aug 2004 20:31:29 -0000
***************
*** 123,128 ****
--- 123,129 ----
        else if (!hmap)
        {
                /* Unable to get shared memory */
+               errno = GetLastError();
                return -1;
        }




Thanks.

//Magnus

Re: REPOST: InitDB Failure on install

От
Tom Lane
Дата:
"Magnus Hagander" <mha@sollentuna.net> writes:
>                 /* Unable to get shared memory */
> +               errno = GetLastError();

Aren't you going to need a mapping function to convert Windows error
codes to errno numbers?  Don't tell me Microsoft was smart enough to
make them the same ;-)

(BTW, there was some discussion around this point while you were gone.
Dunno if you've caught up on the list traffic yet.)

            regards, tom lane

Re: REPOST: InitDB Failure on install

От
Andreas Pflug
Дата:
Tom Lane wrote:
> "Magnus Hagander" <mha@sollentuna.net> writes:
>
>>                /* Unable to get shared memory */
>>+               errno = GetLastError();
>
>
> Aren't you going to need a mapping function to convert Windows error
> codes to errno numbers?  Don't tell me Microsoft was smart enough to
> make them the same ;-)

How about the idea to set errno to a special value after all non-posix
calls, which makes ereport examine/preserve GetLastError() instead?

Regards,
Andreas