Thread: temp patch for win32 readdir issue

temp patch for win32 readdir issue

From
"Magnus Hagander"
Date:
Ok, so I know this is pretty ugly. But there is a bug in mingw (current
release - it's fixed in the snapshot version) with regards to readdir()
(see previous mails on win32-hackers). Basically, it doesn't set errno
correctly.

This patch will catch this error with regards to the readdir(), wrap a
change in #ifdef WIN32, and emit a warning at compile time. This is a
temporary measure until mingw releases a version that has this fixed.

Applying this will make it easier on those who want to compile
postgresql on win32, since it removes a manual step. Which is why I'm
giving it a shot posting it here even though it's ugly.

//Magnus

Attachment

Re: temp patch for win32 readdir issue

From
"Magnus Hagander"
Date:
Oops. Naturally, if this is accepted, the same change needs to be done
in xlog.c. I can update the patch if you want me to, or you can jus
tmanually copy the code over :)

//Magnus

>-----Original Message-----
>From: Magnus Hagander
>Sent: den 4 februari 2004 23:44
>To: pgsql-patches@postgresql.org
>Subject: [PATCHES] temp patch for win32 readdir issue
>
>
>Ok, so I know this is pretty ugly. But there is a bug in mingw (current
>release - it's fixed in the snapshot version) with regards to readdir()
>(see previous mails on win32-hackers). Basically, it doesn't set errno
>correctly.
>
>This patch will catch this error with regards to the readdir(), wrap a
>change in #ifdef WIN32, and emit a warning at compile time. This is a
>temporary measure until mingw releases a version that has this fixed.
>
>Applying this will make it easier on those who want to compile
>postgresql on win32, since it removes a manual step. Which is why I'm
>giving it a shot posting it here even though it's ugly.
>
>//Magnus
>

Re: temp patch for win32 readdir issue

From
Bruce Momjian
Date:
Removed.  Adding new version.

---------------------------------------------------------------------------

Magnus Hagander wrote:
> Ok, so I know this is pretty ugly. But there is a bug in mingw (current
> release - it's fixed in the snapshot version) with regards to readdir()
> (see previous mails on win32-hackers). Basically, it doesn't set errno
> correctly.
>
> This patch will catch this error with regards to the readdir(), wrap a
> change in #ifdef WIN32, and emit a warning at compile time. This is a
> temporary measure until mingw releases a version that has this fixed.
>
> Applying this will make it easier on those who want to compile
> postgresql on win32, since it removes a manual step. Which is why I'm
> giving it a shot posting it here even though it's ugly.
>
> //Magnus

Content-Description: win32_readdir.patch

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: temp patch for win32 readdir issue

From
Bruce Momjian
Date:
We will document this on the win32 TODO list and remove this patch once
MinGW is fixed.

Your patch has been added to the PostgreSQL unapplied patches list at:

    http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Magnus Hagander wrote:
> Ok, so I know this is pretty ugly. But there is a bug in mingw (current
> release - it's fixed in the snapshot version) with regards to readdir()
> (see previous mails on win32-hackers). Basically, it doesn't set errno
> correctly.
>
> This patch will catch this error with regards to the readdir(), wrap a
> change in #ifdef WIN32, and emit a warning at compile time. This is a
> temporary measure until mingw releases a version that has this fixed.
>
> Applying this will make it easier on those who want to compile
> postgresql on win32, since it removes a manual step. Which is why I'm
> giving it a shot posting it here even though it's ugly.
>
> //Magnus

Content-Description: win32_readdir.patch

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: temp patch for win32 readdir issue

From
Neil Conway
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> We will document this on the win32 TODO list and remove this patch once
> MinGW is fixed.

IIRC, Tom and I both suggested that there is no need to clutter the
source tree with a temporary workaround for a platform that hasn't
even seen a stable release yet. Or did I miss something...?

-Neil


Re: temp patch for win32 readdir issue

From
Bruce Momjian
Date:
Neil Conway wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > We will document this on the win32 TODO list and remove this patch once
> > MinGW is fixed.
>
> IIRC, Tom and I both suggested that there is no need to clutter the
> source tree with a temporary workaround for a platform that hasn't
> even seen a stable release yet. Or did I miss something...?

And I replied stating I would apply the patch and add a mention on the
Win32 TODO list to remove it once the platform fixes the problem.  That
seems like the only useful solution.

I don't see a problem with adding it as long as we don't forget to
remove it once it is fixed.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073