From: | yutaka tanida <yutaka(at)marin(dot)or(dot)jp> |
---|---|
To: | Alexei Zakharov <A(dot)S(dot)Zakharov(at)inp(dot)nsk(dot)su> |
Cc: | pgsql-hackers(at)postgreSQL(dot)org |
Subject: | Re: [HACKERS] xlog.c.patch for cygwin port. |
Date: | 2000-03-07 05:25:22 |
Message-ID: | 38C492C232E.8E0EYUTAKA@s34gway.s34.co.jp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
On Mon, 6 Mar 2000 12:06:27 +0600
"Alexei Zakharov" <A(dot)S(dot)Zakharov(at)inp(dot)nsk(dot)su> wrote:
> I suggest a following patch. BTW the situation appeared before,
> see hba.c, pqcomm.c and others.
I propose another patch, against src/include/port/win.h.
If this patch is applied, #ifdef with open() such as following is no
more needed.
--
#ifndef __CYGWIN__
fd=open(path,flags,mode);
#else
fd=open(path,flags | O_BINARY,mode);
#endif
--
Comments?
--
Yutaka tanida / S34 Co., Ltd.
tanida(at)s34(dot)co(dot)jp (Office)
yutaka(at)marin(dot)or(dot)jp(Private, or if you *HATE* Microsoft Outlook)
*** win.h.orig Thu Feb 10 17:00:14 2000
--- win.h Tue Mar 07 14:07:21 2000
***************
*** 10,15 ****
--- 10,35 ----
#define USE_POSIX_TIME
#define HAVE_INT_TIMEZONE /* has int _timezone */
+ /* open() must use with O_BINARY flag */
+
+ #include<stdarg.h>
+ #include<sys/fcntl.h>
+
+ static __inline int pg_cygwin_open(const char *pathname,int flags,...) {
+ va_list va;
+ mode_t mode;
+ if(flags | O_CREAT) {
+ va_start(va,flags);
+ mode=va_arg(va,int);
+ va_end(va);
+ return open(pathname,flags | O_BINARY,mode);
+ }else{
+ return open(pathname,flags | O_BINARY);
+ }
+ }
+
+ #define open pg_cygwin_open
+
#include <cygwin/version.h>
#if (CYGWIN_VERSION_API_MAJOR >= 0) && (CYGWIN_VERSION_API_MINOR >= 8)
#define sys_nerr _sys_nerr
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2000-03-07 06:51:32 | Re: [BUGS] grant/revoke bug with delete/update |
Previous Message | Thomas Lockhart | 2000-03-07 05:16:07 | Re: [HACKERS] sqgfault on initdb with current CVS |