prefer strerror() over sys_errlist[], for sparcv9-solaris2.8
authorKen Raeburn <raeburn@mit.edu>
Thu, 8 Mar 2001 03:40:49 +0000 (03:40 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 8 Mar 2001 03:40:49 +0000 (03:40 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13061 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/gssftp/ChangeLog
src/appl/gssftp/configure.in
src/appl/gssftp/ftp/ChangeLog
src/appl/gssftp/ftp/cmds.c
src/appl/gssftp/ftp/ftp.c
src/appl/gssftp/ftp/secure.c
src/appl/gssftp/ftpd/ChangeLog
src/appl/gssftp/ftpd/ftpd.c

index aa6b11a42f7af525ceff0e163f59b5cdb4b6b6a1..654c5e8ba1dd1c099a1c057915b6f349c8702b75 100644 (file)
@@ -1,3 +1,7 @@
+2001-03-07  Ken Raeburn  <raeburn@mit.edu>
+
+       * configure.in: Check for strerror.
+
 2000-11-01  Ezra Peisach  <epeisach@mit.edu>
 
        * configure.in: Use AC_CHECK_FUNCS, AC_CHECK_HEADERS, AC_C_CONST
index 5a72356cf14d983ffc05df24bcbaf806176740a1..f2d7b659df1368ef24054f65a468d8f7c30df624 100644 (file)
@@ -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 
index 43034a5f0d053f66e731a525c57f8aad01c9513a..74bfbe691bd9b19341d6d5096a35ce6f6ca9e077 100644 (file)
@@ -1,3 +1,9 @@
+2001-03-07  Ken Raeburn  <raeburn@mit.edu>
+
+       * 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  <raeburn@mit.edu>
 
        * cmds.c (globulize): Use correct address of globbed results when
index 3ef5e8d2816cd4ab8479678c3f96e1b23dc9476b..40eff2d3f3ac101c79b39f52e82b07ec49a363e5 100644 (file)
@@ -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[];
index 8c0101a4738cf872798b59d0fb763b4d1bc290c4..17be15c3ad85d9ab58f39fd239f51241281baacc 100644 (file)
@@ -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;
 
index 7599ccf209cc1734c638b29f6e006247d082b5bc..32b190d8fca9068a4bad1d03a46a917b982402e3 100644 (file)
@@ -35,9 +35,12 @@ extern Key_schedule schedule;
 #include <netinet/in.h>
 #include <errno.h>
 
+#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 ... */
index 94ea81743cec5342dd727dbf2cb0af7c856c3a27..8ea2c7222439826e34718e2bbc83eb235616c3cd 100644 (file)
@@ -1,3 +1,7 @@
+2001-03-07  Ken Raeburn  <raeburn@mit.edu>
+
+       * ftpd.c (strerror): Only define if not HAVE_STRERROR.
+
 2000-12-06  Ken Raeburn  <raeburn@mit.edu>
 
        * ftpd.c (dolog): Cast first argument to pty_make_sane_hostname to
index eefd3cb2afb075fd8a65ba13530c76449171e7e6..0cd613e539fcebfde99e313489eaea56d6247191 100644 (file)
@@ -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 ();