From: | The Hermit Hacker <scrappy(at)hub(dot)org> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, yutaka tanida <yutaka(at)marin(dot)or(dot)jp>, Alexei Zakharov <A(dot)S(dot)Zakharov(at)inp(dot)nsk(dot)su>, pgsql-hackers(at)postgreSQL(dot)org |
Subject: | Re: [HACKERS] xlog.c.patch for cygwin port. |
Date: | 2000-03-08 01:19:09 |
Message-ID: | Pine.BSF.4.21.0003072118401.591-100000@thelab.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Sounds like a *great* bug fix to me ... if you "have better things to do",
I can tackle it ...
On Tue, 7 Mar 2000, Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > This looks interesting. We could remove some of our ifwin cruft.
>
> I have been thinking for quite some time that most of the CYGWIN32
> ifdefs represent very poor programming. Instead of zillions of
>
> #ifndef __CYGWIN32__
> fd = open(filename, O_RDONLY, 0666);
> #else
> fd = open(filename, O_RDONLY | O_BINARY, 0666);
> #endif
>
> we should have in one include file something like
>
> #ifndef __CYGWIN32__
> #define OPEN_FLAGS_READ O_RDONLY
> #define OPEN_FLAGS_WRITE O_WRONLY
> // etc for the combinations we need
> #else
> #define OPEN_FLAGS_READ (O_RDONLY | O_BINARY)
> #define OPEN_FLAGS_WRITE (O_WRONLY | O_BINARY)
> // etc
> #endif
>
> and then the body of the code would have
>
> fd = open(filename, OPEN_FLAGS_READ, 0666);
>
> and no ifdef. This would also provide a single place to tweak open()
> flags for other platforms, whereas the existing method is exactly zero
> help for any non-CYGWIN platform that wants to add O_BINARY ...
>
> regards, tom lane
>
> ************
>
Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy(at)hub(dot)org secondary: scrappy(at){freebsd|postgresql}.org
From | Date | Subject | |
---|---|---|---|
Next Message | JB | 2000-03-08 01:24:03 | Re: [HACKERS] 'LIKE' enhancement suggestion |
Previous Message | Tom Lane | 2000-03-08 01:13:53 | Re: [HACKERS] DROP TABLE inside a transaction block |