Re: Use of access(X_OK) check in pg_upgrade

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Use of access(X_OK) check in pg_upgrade
Date: 2011-05-18 16:18:37
Message-ID: BANLkTi=F0th6WvsiMQyMOdVL9MtV97yU=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 18, 2011 at 12:16, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> Magnus Hagander wrote:
>> On Wed, May 18, 2011 at 11:41, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>> > I broke the Win32 build members by using access(X_OK) in pg_upgrade. ?I
>> > have a fix for this but looking at pg_upgrade's exec.c, I see for
>> > Win32:
>> >
>> > ? ? ? ? ? ?if ((buf.st_mode & S_IXUSR) == 0)
>> >
>> > I am confused why Windows supports S_IXUSR but not X_OK.
>>
>> It doesn't natively - we define it in port/win32.h
>
> Sure, but that is defined as _S_IEXEC:
>
>        #define S_IXUSR _S_IEXEC
>        #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
>
> So what is _S_IEXEC.  Anyway, execute permission means something
> different on Win32 for directories so I have a fix applied.

I'm pretty sure it's mapped to read permissions internally in the API headers.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Browne 2011-05-18 16:24:07 Re: deprecating contrib for PGXN
Previous Message Selena Deckelmann 2011-05-18 16:17:23 Adding an example for replication configuration to pg_hba.conf