Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] xlog.c.patch for cygwin port.

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 (view raw or flat)
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


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-03-07 06:51:32
Subject: Re: [BUGS] grant/revoke bug with delete/update
Previous:From: Thomas LockhartDate: 2000-03-07 05:16:07
Subject: Re: [HACKERS] sqgfault on initdb with current CVS

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group