Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd611b07

Browse files
committed
This is an attempt to get rid of some cruft...
According to man page under FreeBSD for sys_errlist[], strerror() should beused instead...not sure if this will break other systems, so only changingtwo files for now, and we'll see what "errors" it turns up
1 parentdcd2332 commitd611b07

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

‎src/backend/utils/error/elog.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.14 1997/03/18 21:30:39 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.15 1997/03/18 21:40:39 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -47,13 +47,6 @@ elog(int lev, const char *fmt, ... )
4747
registerchar*bp;
4848
registerconstchar*cp;
4949
externinterrno,sys_nerr;
50-
#if !defined(BSD44_derived)&& \
51-
!defined(bsdi)&& \
52-
!defined(bsdi_2_1)&& \
53-
!defined(linuxalpha)&& \
54-
!defined(__GLIBC__)
55-
externchar*sys_errlist[];
56-
#endif/* bsd derived */
5750
#ifndefPG_STANDALONE
5851
externFILE*Pfout;
5952
#endif/* !PG_STANDALONE */
@@ -104,7 +97,7 @@ elog(int lev, const char *fmt, ... )
10497
for (cp=fmt;*cp;cp++)
10598
if (*cp=='%'&&*(cp+1)=='m') {
10699
if (errno<sys_nerr&&errno >=0)
107-
strcpy(bp,sys_errlist[errno]);
100+
strcpy(bp,strerror(errno));
108101
else
109102
sprintf(bp,"error %d",errno);
110103
bp+=strlen(bp);

‎src/backend/utils/error/exc.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.11 1997/03/18 21:30:41 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.12 1997/03/18 21:40:41 scrappy Exp $
1111
*
1212
* NOTE
1313
* XXX this code needs improvement--check for state violations and
@@ -93,13 +93,6 @@ ExcPrint(Exception *excP,
9393
{
9494
externinterrno;
9595
externintsys_nerr;
96-
#if !defined(BSD44_derived)&& \
97-
!defined(bsdi)&& \
98-
!defined(bsdi_2_1)&& \
99-
!defined(linuxalpha)&& \
100-
!defined(__GLIBC__)
101-
externchar*sys_errlist[];
102-
#endif/* ! bsd_derived */
10396

10497
#ifdeflint
10598
data=data;
@@ -125,9 +118,8 @@ ExcPrint(Exception *excP,
125118

126119
(void)fprintf(stderr," (%ld)",detail);
127120

128-
if (errno>0&&errno<sys_nerr&&
129-
sys_errlist[errno]!=NULL&&sys_errlist[errno][0]!='\0')
130-
(void)fprintf(stderr," [%s]",sys_errlist[errno]);
121+
if (errno>0&&errno<sys_nerr)
122+
(void)fprintf(stderr," [%s]",strerror(errno));
131123
elseif (errno!=0)
132124
(void)fprintf(stderr," [Error %d]",errno);
133125

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp