Re: CVS tip problems

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: CVS tip problems
Date: 2004-06-01 07:23:07
Message-ID: 1086074587.27765.1056.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Tue, 2004-06-01 at 01:33, Tom Lane wrote:
> First you might want to check which flavor of strerror_r() your platform
> has --- does it return int or char* ?

I made the following change to the strerror_r call, which makes it work
correctly with threading enabled:

--- src/port/thread.c 23 Apr 2004 18:15:55 -0000 1.20
+++ src/port/thread.c 1 Jun 2004 07:18:26 -0000
@@ -71,7 +71,8 @@
#if defined(FRONTEND) && defined(ENABLE_THREAD_SAFETY) && defined(HAVE_STRERROR_R)
/* reentrant strerror_r is available */
/* some early standards had strerror_r returning char * */
- strerror_r(errnum, strerrbuf, buflen);
+ char buf[256];
+ StrNCpy(strerrbuf, strerror_r(errnum, buf, 256), buflen);
return strerrbuf;

#else

(I realise this is not sufficient for a patch to correct the problem.)
--
Oliver Elphick olly(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
========================================
"Thou will show me the path of life; in thy presence
is fullness of joy; at thy right hand there are
pleasures for evermore." Psalms 16:11

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2004-06-01 07:29:49 Re: New btree_gist code has a few problems
Previous Message Tom Lane 2004-06-01 05:59:45 New btree_gist code has a few problems

Browse pgsql-patches by date

  From Date Subject
Next Message Harald Fuchs 2004-06-01 08:10:38 Re: pg_dump --comment?
Previous Message Serguei A. Mokhov 2004-06-01 06:08:30 Re: Fully enabling NLS in pg_ctl