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

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 (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-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;

(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                    
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


pgsql-hackers by date

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

pgsql-patches by date

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

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