aboutsummaryrefslogtreecommitdiff
path: root/src
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
parent60b282fd260f4c7fa42af438a555b3df7dd7dd47 (diff)
downloadpostgresql-e9c936ff38da738d1fd68525eee9c7c1f0c558dc.tar.gz
postgresql-e9c936ff38da738d1fd68525eee9c7c1f0c558dc.zip
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')
-rw-r--r--src/backend/utils/error/elog.c15
-rw-r--r--src/backend/utils/error/exc.c15
-rw-r--r--src/include/config.h.in5
3 files changed, 5 insertions, 30 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index 6a842bd469f..1b70912a162 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.
diff --git a/src/backend/utils/error/exc.c b/src/backend/utils/error/exc.c
index 6f5420712e4..86cd070f0c5 100644
--- a/src/backend/utils/error/exc.c
+++ b/src/backend/utils/error/exc.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.34 2001/01/21 00:59:26 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/error/Attic/exc.c,v 1.35 2001/01/22 23:28:52 tgl Exp $
*
* NOTE
* XXX this code needs improvement--check for state violations and
@@ -26,10 +26,6 @@
extern int errno;
-#ifdef HAVE_SYS_NERR
-extern int sys_nerr;
-#endif
-
static void ExcUnCaught(Exception *excP, ExcDetail detail, ExcData data,
ExcMessage message);
@@ -115,14 +111,7 @@ ExcPrint(Exception *excP,
#endif
/* 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.
diff --git a/src/include/config.h.in b/src/include/config.h.in
index 1367a5ab4bc..5c2dc088ef2 100644
--- a/src/include/config.h.in
+++ b/src/include/config.h.in
@@ -8,7 +8,7 @@
* or in config.h afterwards. Of course, if you edit config.h, then your
* changes will be overwritten the next time you run configure.
*
- * $Id: config.h.in,v 1.156 2001/01/19 23:43:35 petere Exp $
+ * $Id: config.h.in,v 1.157 2001/01/22 23:28:52 tgl Exp $
*/
#ifndef CONFIG_H
@@ -617,9 +617,6 @@ extern void srandom(unsigned int seed);
/* Define if you have the optreset variable */
#undef HAVE_INT_OPTRESET
-/* Define if you have the sys_nerr global variable */
-#undef HAVE_SYS_NERR
-
/* Define if you have strtoll() */
#undef HAVE_STRTOLL