Thanks for the report.
I noticed that at least a few of your changes are already
part of the latest test release. Would you please try that
and send any diffs relative to it?
ftp://alpha.gnu.org/gnu/fetish/sh-utils-2.0g.tar.gz
Why do you want to change the strdup call in canon-host.c to xstrdup?
If any changes to non-generated files remain (i.e., don't include
diffs to automatically-generated files like date-tests), please give
some motivation for them, preferably in the form of ChangeLog entries.
"John David Anglin" <[EMAIL PROTECTED]> writes:
| The following patch allows sh-utils-2.0 to build and check successfully
| under VAX Ultrix 4.3. Some of the fixes are probably relevant for other
| systems as well.
|
| --
| J. David Anglin [EMAIL PROTECTED]
| National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
|
| diff -ur sh-utils-2.0/lib/canon-host.c sh-utils-2.0.new/lib/canon-host.c
| --- sh-utils-2.0/lib/canon-host.c Wed Mar 10 10:05:34 1999
| +++ sh-utils-2.0.new/lib/canon-host.c Thu Mar 23 14:09:11 2000
| @@ -43,6 +43,7 @@
| # include <arpa/inet.h>
| #endif
|
| +char *xstrdup();
| void free ();
|
| /* Returns the canonical hostname associated with HOST (allocated in a static
| @@ -77,7 +78,7 @@
| directly to gethostbyaddr because on some systems he->h_addr
| is located in a static library buffer that is reused in the
| gethostbyaddr call. Make a copy and use that instead. */
| - char *h_addr_copy = strdup (he->h_addr);
| + char *h_addr_copy = xstrdup (he->h_addr);
| if (h_addr_copy == NULL)
| he = NULL;
| else
| Only in sh-utils-2.0.new/lib: lstat.c
| diff -ur sh-utils-2.0/lib/readutmp.c sh-utils-2.0.new/lib/readutmp.c
| --- sh-utils-2.0/lib/readutmp.c Wed May 5 09:30:31 1999
| +++ sh-utils-2.0.new/lib/readutmp.c Thu Mar 23 13:16:14 2000
| @@ -21,6 +21,8 @@
|
| #include <stdio.h>
|
| +#include <sys/types.h>
| +
| #include <sys/stat.h>
| #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
| # include <string.h>
| diff -ur sh-utils-2.0/lib/readutmp.h sh-utils-2.0.new/lib/readutmp.h
| --- sh-utils-2.0/lib/readutmp.h Wed May 5 09:30:29 1999
| +++ sh-utils-2.0.new/lib/readutmp.h Thu Mar 23 15:02:05 2000
| @@ -40,6 +40,9 @@
| # define UTMP_NAME_FUNCTION utmpxname
| # else
| # include <utmp.h>
| +# ifndef HAVE_DECL_GETUTENT
| +struct utmp *getutent();
| +# endif
| # define UTMP_STRUCT_NAME utmp
| # define UT_TIME_MEMBER(UT_PTR) ((UT_PTR)->ut_time)
| # define SET_UTMP_ENT setutent
| Only in sh-utils-2.0.new/lib: stat.c
| diff -ur sh-utils-2.0/m4/check-decl.m4 sh-utils-2.0.new/m4/check-decl.m4
| --- sh-utils-2.0/m4/check-decl.m4 Sun Jan 10 17:40:27 1999
| +++ sh-utils-2.0.new/m4/check-decl.m4 Thu Mar 23 18:39:46 2000
| @@ -23,6 +23,9 @@
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| +#ifndef HAVE_UTMPX_H
| +# include <utmp.h>
| +#endif
| '
|
| if test x = y; then
| @@ -32,6 +35,7 @@
| dnl Otherwise, I'd have to update acconfig.h every time I change
| dnl this list of functions.
| AC_DEFINE(HAVE_DECL_FREE, 1, [Define if this function is declared.])
| + AC_DEFINE(HAVE_DECL_GETUTENT, 1, [Define if this function is declared.])
| AC_DEFINE(HAVE_DECL_LSEEK, 1, [Define if this function is declared.])
| AC_DEFINE(HAVE_DECL_MALLOC, 1, [Define if this function is declared.])
| AC_DEFINE(HAVE_DECL_MEMCHR, 1, [Define if this function is declared.])
| @@ -40,6 +44,6 @@
| AC_DEFINE(HAVE_DECL_STRSTR, 1, [Define if this function is declared.])
| fi
|
| - jm_CHECK_DECLARATIONS($headers, free lseek malloc \
| + jm_CHECK_DECLARATIONS($headers, free getutent lseek malloc \
| memchr realloc stpcpy strstr)
| ])
| diff -ur sh-utils-2.0/m4/jm-macros.m4 sh-utils-2.0.new/m4/jm-macros.m4
| --- sh-utils-2.0/m4/jm-macros.m4 Wed Aug 4 10:35:55 1999
| +++ sh-utils-2.0.new/m4/jm-macros.m4 Thu Mar 23 18:35:56 2000
| @@ -4,7 +4,7 @@
|
| AC_DEFUN(jm_MACROS,
| [
| - AC_PREREQ(2.14.1) dnl Minimum Autoconf version required.
| + AC_PREREQ(2.13) dnl Minimum Autoconf version required.
|
| GNU_PACKAGE="GNU $PACKAGE"
| AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
| diff -ur sh-utils-2.0/tests/date/date-tests sh-utils-2.0.new/tests/date/date-tests
| --- sh-utils-2.0/tests/date/date-tests Fri Jan 29 08:30:19 1999
| +++ sh-utils-2.0.new/tests/date/date-tests Thu Mar 23 18:06:13 2000