From 31a6b859eed2532174b920699ba1e21849cc4204 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Thu, 8 Mar 2001 03:40:49 +0000 Subject: [PATCH] prefer strerror() over sys_errlist[], for sparcv9-solaris2.8 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13061 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/gssftp/ChangeLog | 4 ++++ src/appl/gssftp/configure.in | 2 +- src/appl/gssftp/ftp/ChangeLog | 6 ++++++ src/appl/gssftp/ftp/cmds.c | 2 ++ src/appl/gssftp/ftp/ftp.c | 2 ++ src/appl/gssftp/ftp/secure.c | 11 +++++++---- src/appl/gssftp/ftpd/ChangeLog | 4 ++++ src/appl/gssftp/ftpd/ftpd.c | 2 ++ 8 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/appl/gssftp/ChangeLog b/src/appl/gssftp/ChangeLog index aa6b11a42..654c5e8ba 100644 --- a/src/appl/gssftp/ChangeLog +++ b/src/appl/gssftp/ChangeLog @@ -1,3 +1,7 @@ +2001-03-07 Ken Raeburn + + * configure.in: Check for strerror. + 2000-11-01 Ezra Peisach * configure.in: Use AC_CHECK_FUNCS, AC_CHECK_HEADERS, AC_C_CONST diff --git a/src/appl/gssftp/configure.in b/src/appl/gssftp/configure.in index 5a72356cf..f2d7b659d 100644 --- a/src/appl/gssftp/configure.in +++ b/src/appl/gssftp/configure.in @@ -19,7 +19,7 @@ AC_CHECK_HEADERS(unistd.h stdlib.h string.h sys/select.h sys/sockio.h paths.h) CHECK_UTMP DECLARE_SYS_ERRLIST AC_REPLACE_FUNCS(getdtablesize) -AC_CHECK_FUNCS(getcwd getdtablesize getusershell seteuid setreuid setresuid) +AC_CHECK_FUNCS(getcwd getdtablesize getusershell seteuid setreuid setresuid strerror) AC_CHECK_LIB(crypt,crypt) dnl AC_CHECK_LIB(util,logwtmp) dnl dnl diff --git a/src/appl/gssftp/ftp/ChangeLog b/src/appl/gssftp/ftp/ChangeLog index 43034a5f0..74bfbe691 100644 --- a/src/appl/gssftp/ftp/ChangeLog +++ b/src/appl/gssftp/ftp/ChangeLog @@ -1,3 +1,9 @@ +2001-03-07 Ken Raeburn + + * cmds.c (strerror): Only define if not HAVE_STRERROR. + * ftp.c (strerror): Likewise. + * secure.c (secure_putbuf, secure_getbyte): Use strerror. + 2000-11-21 Ken Raeburn * cmds.c (globulize): Use correct address of globbed results when diff --git a/src/appl/gssftp/ftp/cmds.c b/src/appl/gssftp/ftp/cmds.c index 3ef5e8d28..40eff2d3f 100644 --- a/src/appl/gssftp/ftp/cmds.c +++ b/src/appl/gssftp/ftp/cmds.c @@ -75,10 +75,12 @@ extern char *globerr; extern char *home; extern char *remglob(); extern char *getenv(); +#ifndef HAVE_STRERROR #define strerror(error) (sys_errlist[error]) #ifdef NEED_SYS_ERRLIST extern char *sys_errlist[]; #endif +#endif extern off_t restart_point; extern char reply_string[]; diff --git a/src/appl/gssftp/ftp/ftp.c b/src/appl/gssftp/ftp/ftp.c index 8c0101a47..17be15c3a 100644 --- a/src/appl/gssftp/ftp/ftp.c +++ b/src/appl/gssftp/ftp/ftp.c @@ -170,10 +170,12 @@ sig_t lostpeer(); off_t restart_point = 0; jmp_buf ptabort; +#ifndef HAVE_STRERROR #define strerror(error) (sys_errlist[error]) #ifdef NEED_SYS_ERRLIST extern char *sys_errlist[]; #endif +#endif extern int connected; diff --git a/src/appl/gssftp/ftp/secure.c b/src/appl/gssftp/ftp/secure.c index 7599ccf20..32b190d8f 100644 --- a/src/appl/gssftp/ftp/secure.c +++ b/src/appl/gssftp/ftp/secure.c @@ -35,9 +35,12 @@ extern Key_schedule schedule; #include #include +#ifndef HAVE_STRERROR +#define strerror(error) (sys_errlist[error]) #ifdef NEED_SYS_ERRLIST extern char *sys_errlist[]; #endif +#endif #if (SIZEOF_SHORT == 4) typedef unsigned short ftp_uint32; @@ -248,7 +251,7 @@ unsigned int nbyte; } else { bufsize = 0; secure_error("%s (in malloc of PROT buffer)", - sys_errlist[errno]); + strerror(errno)); return(ERR); } } @@ -295,7 +298,7 @@ unsigned int nbyte; } else { bufsize = 0; secure_error("%s (in malloc of PROT buffer)", - sys_errlist[errno]); + strerror(errno)); return(ERR); } } @@ -326,7 +329,7 @@ int fd; != sizeof(length)) { secure_error("Couldn't read PROT buffer length: %d/%s", kerror, - kerror == -1 ? sys_errlist[errno] + kerror == -1 ? strerror(errno) : "premature EOF"); return(ERR); } @@ -338,7 +341,7 @@ int fd; if ((kerror = looping_read(fd, (char *) ucbuf, (int) length)) != length) { secure_error("Couldn't read %u byte PROT buffer: %s", length, kerror == -1 ? - sys_errlist[errno] : "premature EOF"); + strerror(errno) : "premature EOF"); return(ERR); } /* Other auth types go here ... */ diff --git a/src/appl/gssftp/ftpd/ChangeLog b/src/appl/gssftp/ftpd/ChangeLog index 94ea81743..8ea2c7222 100644 --- a/src/appl/gssftp/ftpd/ChangeLog +++ b/src/appl/gssftp/ftpd/ChangeLog @@ -1,3 +1,7 @@ +2001-03-07 Ken Raeburn + + * ftpd.c (strerror): Only define if not HAVE_STRERROR. + 2000-12-06 Ken Raeburn * ftpd.c (dolog): Cast first argument to pty_make_sane_hostname to diff --git a/src/appl/gssftp/ftpd/ftpd.c b/src/appl/gssftp/ftpd/ftpd.c index eefd3cb2a..0cd613e53 100644 --- a/src/appl/gssftp/ftpd/ftpd.c +++ b/src/appl/gssftp/ftpd/ftpd.c @@ -109,10 +109,12 @@ static char sccsid[] = "@(#)ftpd.c 5.40 (Berkeley) 7/2/91"; #define L_INCR 1 #endif +#ifndef HAVE_STRERROR #define strerror(error) (sys_errlist[error]) #ifdef NEED_SYS_ERRLIST extern char *sys_errlist[]; #endif +#endif extern char *mktemp (); -- 2.26.2