summaryrefslogtreecommitdiff
path: root/src/backend/utils/error/elog.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-01-22 23:28:52 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-01-22 23:28:52 +0000
commite9c936ff38da738d1fd68525eee9c7c1f0c558dc (patch)
tree0f20d770bb2d410b2f2fd360475b8690591d9e44 /src/backend/utils/error/elog.c
parent60b282fd260f4c7fa42af438a555b3df7dd7dd47 (diff)
downloadpostgresql-e9c936ff38da738d1fd68525eee9c7c1f0c558dc.tar.gz
Remove rangechecks on errno; just call strerror unconditionally. This
eliminates a raft of portability issues, including whether sys_nerr exists, whether the platform has any valid negative errnos, etc. The downside is minimal: errno shouldn't ever contain an invalid value anyway, and if it does, reasonably modern versions of strerror will not choke. This rangecheck idea seemed good at the time, but it's clearly a net loss, and I apologize to all concerned for having ever put it in.
Diffstat (limited to 'src/backend/utils/error/elog.c')
-rw-r--r--src/backend/utils/error/elog.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index 6a842bd469..1b70912a16 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.78 2001/01/21 00:59:26 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.79 2001/01/22 23:28:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -43,10 +43,6 @@
extern int errno;
-#ifdef HAVE_SYS_NERR
-extern int sys_nerr;
-#endif
-
extern CommandDest whereToSendOutput;
#ifdef ENABLE_SYSLOG
@@ -139,14 +135,7 @@ elog(int lev, const char *fmt, ...)
return; /* ignore debug msgs if noplace to send */
/* Save error str before calling any function that might change errno */
- if (errno >= 0
-#ifdef HAVE_SYS_NERR
- && errno <= sys_nerr
-#endif
- )
- errorstr = strerror(errno);
- else
- errorstr = NULL;
+ errorstr = strerror(errno);
/*
* Some strerror()s return an empty string for out-of-range errno.
* This is ANSI C spec compliant, but not exactly useful.