From fba790ad586727c54d0ed12f3c9679f9533d2c6f Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 22 Oct 2000 22:15:13 +0000 Subject: Makeover for Unixware 7.1.1 * Makefile: Add more standard targets. Improve shell redirection in GNU make detection. * src/backend/access/transam/rmgr.c: Fix incorrect(?) C. * src/backend/libpq/pqcomm.c (StreamConnection): Work around accept() bug. * src/include/port/unixware.h: ...with help from here. * src/backend/nodes/print.c (plannode_type): Remove some "break"s after "return"s. * src/backend/tcop/dest.c (DestToFunction): ditto. * src/backend/nodes/readfuncs.c: Add proper prototypes. * src/backend/utils/adt/numutils.c (pg_atoi): Cope specially with strtol() setting EINVAL. This saves us from creating an extra set of regression test output for the affected systems. * src/include/storage/s_lock.h (tas): Correct prototype. * src/interfaces/libpq/fe-connect.c (parseServiceInfo): Don't use variable as dimension in array definition. * src/makefiles/Makefile.unixware: Add support for GCC. * src/template/unixware: same here * src/test/regress/expected/abstime-solaris-1947.out: Adjust whitespace. * src/test/regress/expected/horology-solaris-1947.out: Part of this file was evidently missing. * src/test/regress/pg_regress.sh: Fix shell. mkdir -p returns non-zero if the directory exists. * src/test/regress/resultmap: Add entries for Unixware. --- src/backend/utils/adt/numutils.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/numutils.c') diff --git a/src/backend/utils/adt/numutils.c b/src/backend/utils/adt/numutils.c index ea188e70f31..9291439cfa6 100644 --- a/src/backend/utils/adt/numutils.c +++ b/src/backend/utils/adt/numutils.c @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.42 2000/08/01 18:29:35 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.43 2000/10/22 22:14:56 petere Exp $ * *------------------------------------------------------------------------- */ @@ -63,7 +63,13 @@ pg_atoi(char *s, int size, int c) l = (long) 0; else l = strtol(s, &badp, 10); - if (errno) /* strtol must set ERANGE */ + /* + * strtol() normally only sets ERANGE. On some systems it also + * may set EINVAL, which simply means it couldn't parse the + * input string. This is handled by the second "if" consistent + * across platforms. + */ + if (errno && errno != EINVAL) elog(ERROR, "pg_atoi: error reading \"%s\": %m", s); if (badp && *badp && (*badp != c)) elog(ERROR, "pg_atoi: error in \"%s\": can\'t parse \"%s\"", s, badp); -- cgit v1.2.3