Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-13 Thread Andrew Dunstan
On 12/13/2010 12:54 AM, Glen Knowles wrote: On Sun, Dec 12, 2010 at 8:16 AM, Tom Lane t...@sss.pgh.pa.us mailto:t...@sss.pgh.pa.us wrote: What are the values of _S_IREAD and _S_IWRITE, anyway? I'm still wondering how come the previous coding with hardwired constants behaved

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-12 Thread Tom Lane
I wrote: Magnus Hagander mag...@hagander.net writes: On Sat, Dec 11, 2010 at 18:46, Tom Lane t...@sss.pgh.pa.us wrote: I think we can just #define the other cases as zeroes.  I'm not sure why you think that's an issue for open --- the privileges don't exist. Hmm. I was/am worried about any

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-12 Thread Andrew Dunstan
On 12/12/2010 11:16 AM, Tom Lane wrote: I put in #define's for these, and it seems to have fixed the MSVC buildfarm members, but cygwin is still broken. How come ... doesn't that port use port/win32.h? ITYM Mingw. And yes, it does use port/win32.h; narwhal's log says: config.status:

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-12 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: On 12/12/2010 11:16 AM, Tom Lane wrote: I put in #define's for these, and it seems to have fixed the MSVC buildfarm members, but cygwin is still broken. How come ... doesn't that port use port/win32.h? ITYM Mingw. And yes, it does use port/win32.h;

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-12 Thread Glen Knowles
On Sun, Dec 12, 2010 at 8:16 AM, Tom Lane t...@sss.pgh.pa.us wrote: What are the values of _S_IREAD and _S_IWRITE, anyway? I'm still wondering how come the previous coding with hardwired constants behaved correctly. Still curious about this. FWIW, _S_IREAD and _S_IWRITE are defined by

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-11 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: This broke the buildfarm on Windows, and I'm not sure of the best way to fix it. We currently define read and write permissions in port/win32.h specifically for windows. A quick-fix to just add these new ones as aliases won't work, because they are

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-11 Thread Tom Lane
I wrote: Magnus Hagander mag...@hagander.net writes: This broke the buildfarm on Windows, and I'm not sure of the best way to fix it. Hm, those symbols are already in use elsewhere in the code; I would assume it's just a matter of missing #includes in these particular files. Where does

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-11 Thread Magnus Hagander
On Sat, Dec 11, 2010 at 17:13, Tom Lane t...@sss.pgh.pa.us wrote: I wrote: Magnus Hagander mag...@hagander.net writes: This broke the buildfarm on Windows, and I'm not sure of the best way to fix it. Hm, those symbols are already in use elsewhere in the code; I would assume it's just a

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-11 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: On Sat, Dec 11, 2010 at 17:13, Tom Lane t...@sss.pgh.pa.us wrote: Ah, I have a theory: fcntl.h. Nope, not there. I can't find S_IWGRP in any of the files. Well, I notice that copydir.c compiled before, and still compiles after, despite this change:

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-11 Thread Magnus Hagander
On Sat, Dec 11, 2010 at 17:23, Tom Lane t...@sss.pgh.pa.us wrote: Magnus Hagander mag...@hagander.net writes: On Sat, Dec 11, 2010 at 17:13, Tom Lane t...@sss.pgh.pa.us wrote: Ah, I have a theory: fcntl.h. Nope, not there. I can't find S_IWGRP in any of the files. Well, I notice that

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-11 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: On Sat, Dec 11, 2010 at 17:23, Tom Lane t...@sss.pgh.pa.us wrote: I think the reason it's not failing is that it includes fcntl.h. S_IRWXU is defined in port/win32.h... No, it isn't. There's an apparently-useless definition of _S_IRWXU there, but

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-11 Thread Magnus Hagander
On Sat, Dec 11, 2010 at 17:38, Tom Lane t...@sss.pgh.pa.us wrote: Magnus Hagander mag...@hagander.net writes: On Sat, Dec 11, 2010 at 17:23, Tom Lane t...@sss.pgh.pa.us wrote: I think the reason it's not failing is that it includes fcntl.h. S_IRWXU is defined in port/win32.h... No, it

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-11 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: On Sat, Dec 11, 2010 at 17:38, Tom Lane t...@sss.pgh.pa.us wrote: No, it isn't.  There's an apparently-useless definition of _S_IRWXU there, but no S_IRWXU. Hmm. You're right, of course. A search on my windows box finds the text string S_IRWXU in

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-11 Thread Magnus Hagander
On Sat, Dec 11, 2010 at 17:55, Tom Lane t...@sss.pgh.pa.us wrote: Magnus Hagander mag...@hagander.net writes: On Sat, Dec 11, 2010 at 17:38, Tom Lane t...@sss.pgh.pa.us wrote: No, it isn't.  There's an apparently-useless definition of _S_IRWXU there, but no S_IRWXU. Hmm. You're right, of

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-11 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: On Sat, Dec 11, 2010 at 17:55, Tom Lane t...@sss.pgh.pa.us wrote: 2. Why didn't the previously hard-wired constants passed to chmod and umask fail on Windows?  The M$ documentation I can find at the moment suggests that *only* _S_IREAD and _S_IWRITE

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-11 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: On Sat, Dec 11, 2010 at 17:55, Tom Lane t...@sss.pgh.pa.us wrote: 1. How did all those pre-existing references to S_IRXWU compile? Yeah, that's weird. IIRC (I stopped looking for the moment, need a step back) some of them were protected by #ifndef

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-11 Thread Magnus Hagander
On Sat, Dec 11, 2010 at 18:46, Tom Lane t...@sss.pgh.pa.us wrote: Magnus Hagander mag...@hagander.net writes: On Sat, Dec 11, 2010 at 17:55, Tom Lane t...@sss.pgh.pa.us wrote: 1. How did all those pre-existing references to S_IRXWU compile? Yeah, that's weird. IIRC (I stopped looking for the

Re: [HACKERS] [COMMITTERS] pgsql: Use symbolic names not octal constants for file permission flags

2010-12-11 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: On Sat, Dec 11, 2010 at 18:46, Tom Lane t...@sss.pgh.pa.us wrote: I think we can just #define the other cases as zeroes.  I'm not sure why you think that's an issue for open --- the privileges don't exist. Hmm. I was/am worried about any case that