delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/10/26/05:26:38

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: Pete Forman <gsez020 AT kryten DOT bedford DOT waii DOT com>
MIME-Version: 1.0
Message-ID: <14839.63617.57912.476939@kryten.bedford.waii.com>
Date: Thu, 26 Oct 2000 10:25:21 +0100 (BST)
To: Jason Tishler <Jason DOT Tishler AT dothill DOT com>
Cc: pgsql-ports AT postgresql DOT org, Cygwin <cygwin AT sources DOT redhat DOT com>
Subject: Re: [PORTS] [PATCH]: Building PostgreSQL 7.0.2 on Cygwin 1.1.4 (T ake 2)
In-Reply-To: <20001019092848.C1023@dothill.com>
References: <B34839947C5FD2118D9100A0C9D5DE4305235F89 AT atl-nt-ex1 DOT eclipsnet DOT com>
<20001018115611 DOT A1018 AT dothill DOT com>
<14830 DOT 40379 DOT 6191 DOT 807752 AT kryten DOT bedford DOT waii DOT com>
<20001019092848 DOT C1023 AT dothill DOT com>
X-Mailer: VM 6.72 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid

--MFazDoqLgw
Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit

Jason Tishler writes:
 > On Thu, Oct 19, 2000 at 08:07:39AM +0100, Pete Forman wrote:
 > > Jason Tishler writes:
 > >  > Unfortunately, two different version of the Cygwin DLL can not
 > >  > coexist on the same system.  So, if some app needs the b20 DLL and
 > >  > PostgreSQL needs the 1.1.4 DLL you are SOL.
 > > 
 > > Why so?  I have both B20.1 and 1.1.4 on my system at the moment.  PATH
 > > determines which is used by any particular app.  And as Earnie says,
 > > the 1.1.4 DLL should be good for older apps.
 > 
 > I was wrong.  I thought that b20.1 used cygwin.dll not cygwin1.dll --
 > it's been a while since I used b20.1.  I'm very glad to hear that older
 > apps can use the 1.1.4 DLL too.
 > 
 > BTW since you have b20.1, would you be willing to build and test my
 > patched version of PostgreSQL 7.0.2?

That test is now done.  The only tests that fail are those involving
timezones.

The build and test was not that smooth.  Overall I'd recommend
upgrading to Cygwin 1.1.4 or later rather than applying all the fixes
needed for B20.1.

I revised Jason's patches for two of the files.  My attached patch is
against the original 7.0.2 code.  Jason's patch should be edited to
remove the sections for backend/utils/error/elog.c and exc.c.  His
patch was posted to PORTS on Tue, 26 Sep 2000 15:21:46 -0400.

This patch is for 7.0.2.  I am sending a patch to do the same thing
for 7.1 to the PATCHES mailing list.  It works around the lack of
sys_nerr on Cygwin B20.1 and BeOS.  More details on pgsql-patches.


--MFazDoqLgw
Content-Type: text/plain
Content-Description: elog & exc for 7.0.2
Content-Disposition: attachment;
	filename="error.patch"
Content-Transfer-Encoding: 7bit

*** src/backend/utils/error/elog.c.orig	Sat Apr 15 20:13:08 2000
--- src/backend/utils/error/elog.c	Fri Oct 20 14:56:05 2000
***************
*** 37,45 ****
  #include "utils/trace.h"
  #include "commands/copy.h"
  
- extern int	errno;
- extern int	sys_nerr;
- 
  extern CommandDest whereToSendOutput;
  
  #ifdef USE_SYSLOG
--- 37,42 ----
***************
*** 105,110 ****
--- 102,108 ----
  	char	   *bp;
  	int			indent = 0;
  	int			space_needed;
+         int			errno_copy = errno;
  
  #ifdef USE_SYSLOG
  	int			log_level;
***************
*** 154,165 ****
  			break;
  	}
  
! 	/* get errno string for %m */
! 	if (errno < sys_nerr && errno >= 0)
! 		errorstr = strerror(errno);
! 	else
  	{
! 		sprintf(errorstr_buf, "error %d", errno);
  		errorstr = errorstr_buf;
  	}
  
--- 152,173 ----
  			break;
  	}
  
! 	/*
! 	 * get errno string for %m
! 	 * Standard UNIX (XPG4v2/UNIX95 and later) says that errno will be set
! 	 * (to EINVAL) if the argument to strerror() is out of range.
! 	 * IRIX and Solaris actually return NULL without setting errno.
! 	 * Others such as AIX, Cygwin and Linux return a string for all values.
! 	 *   This string contains a number for out of range values.
! 	 * HPUX and QNX return the same string for all out of range values.
! 	 *   Those will not be well served by this code.  However it is highly
! 	 *   unlikely that this code will be called with an out of range errno.
! 	 */
! 	errno = 0;
! 	errorstr = strerror(errno_copy);
! 	if (errno != 0 || errorstr == NULL)
  	{
! 		sprintf(errorstr_buf, "error %d", errno_copy);
  		errorstr = errorstr_buf;
  	}
  
*** src/backend/utils/error/exc.c.orig	Wed Jan 26 06:57:20 2000
--- src/backend/utils/error/exc.c	Fri Oct 20 15:59:06 2000
***************
*** 100,108 ****
  		 ExcData data,
  		 ExcMessage message)
  {
! 	extern int	errno;
! 	extern int	sys_nerr;
! 
  #ifdef	lint
  	data = data;
  #endif
--- 100,108 ----
  		 ExcData data,
  		 ExcMessage message)
  {
! 	int errno_copy = errno;
! 	const char *errorstr;
!         
  #ifdef	lint
  	data = data;
  #endif
***************
*** 127,136 ****
  
  	fprintf(stderr, " (%ld)", detail);
  
! 	if (errno > 0 && errno < sys_nerr)
! 		fprintf(stderr, " [%s]", strerror(errno));
! 	else if (errno != 0)
! 		fprintf(stderr, " [Error %d]", errno);
  
  	fprintf(stderr, "\n");
  
--- 127,140 ----
  
  	fprintf(stderr, " (%ld)", detail);
  
! 	if (errno_copy != 0) {
! 		errno = 0;
! 		errorstr = strerror(errno_copy);
! 		if (errno == 0 && errorstr != NULL)
! 			fprintf(stderr, " [Error %d: %s]", errno_copy, errorstr);
! 		else if (errno_copy != 0)
! 			fprintf(stderr, " [Error %d]", errno_copy);
! 	}
  
  	fprintf(stderr, "\n");
  

--MFazDoqLgw
Content-Type: text/plain; charset=us-ascii
Content-Description: .signature
Content-Transfer-Encoding: 7bit


-- 
Pete Forman                 -./\.- Disclaimer: This post is originated
Western Geophysical           -./\.-  by myself and does not represent
pete DOT forman AT westgeo DOT com         -./\.-  the opinion of Baker Hughes or
http://www.crosswinds.net/~petef  -./\.-  its divisions.


--MFazDoqLgw
Content-Type: text/plain; charset=us-ascii

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
--MFazDoqLgw--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019