From 28d6eb8e997fad52f332a974d924881cb3d91ce2 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Thu, 24 Apr 2003 03:28:00 +0000 Subject: [PATCH] errno should never be explicitly declared Remove explicit declarations of errno; include errno.h as needed. (Also, errmsg in krb4, and malloc in compile_et.) ticket: new target_version: 1.3 tags: pullup status: resolved git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15368 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/telnet/telnet/ChangeLog | 4 ++++ src/appl/telnet/telnet/externs.h | 4 ---- src/appl/telnet/telnetd/ChangeLog | 4 ++++ src/appl/telnet/telnetd/telnetd.h | 1 - src/kadmin/dbutil/ChangeLog | 4 ++++ src/kadmin/dbutil/kdb5_destroy.c | 1 - src/kadmin/dbutil/kdb5_stash.c | 2 -- src/lib/des425/ChangeLog | 5 +++++ src/lib/des425/quad_cksum.c | 4 ---- src/lib/des425/t_pcbc.c | 2 -- src/lib/des425/t_quad.c | 2 -- src/lib/des425/verify.c | 2 -- src/lib/rpc/ChangeLog | 7 +++++++ src/lib/rpc/bindresvport.c | 2 +- src/lib/rpc/clnt_tcp.c | 2 -- src/lib/rpc/svc.c | 3 +-- src/util/et/ChangeLog | 6 ++++++ src/util/et/compile_et.c | 6 ++---- src/util/et/test_et.c | 2 -- src/util/ss/ChangeLog | 4 ++++ src/util/ss/ss.h | 3 +-- 21 files changed, 39 insertions(+), 31 deletions(-) diff --git a/src/appl/telnet/telnet/ChangeLog b/src/appl/telnet/telnet/ChangeLog index bcc361750..60f9bf1f0 100644 --- a/src/appl/telnet/telnet/ChangeLog +++ b/src/appl/telnet/telnet/ChangeLog @@ -1,3 +1,7 @@ +2003-04-23 Ken Raeburn + + * externs.h: Don't declare errno. + 2003-01-07 Ken Raeburn * Makefile.orig: Deleted. diff --git a/src/appl/telnet/telnet/externs.h b/src/appl/telnet/telnet/externs.h index 65a1c67c0..dccb424f0 100644 --- a/src/appl/telnet/telnet/externs.h +++ b/src/appl/telnet/telnet/externs.h @@ -111,10 +111,6 @@ extern char *malloc(), *calloc(), *realloc(); #define SUBBUFSIZE 256 -#ifndef CRAY -extern int errno; /* outside this world */ -#endif /* !CRAY */ - extern int autologin, /* Autologin enabled */ skiprc, /* Don't process the ~/.telnetrc file */ diff --git a/src/appl/telnet/telnetd/ChangeLog b/src/appl/telnet/telnetd/ChangeLog index c380d11f8..b343e9cc0 100644 --- a/src/appl/telnet/telnetd/ChangeLog +++ b/src/appl/telnet/telnetd/ChangeLog @@ -1,3 +1,7 @@ +2003-04-23 Ken Raeburn + + * telnetd.h: Don't declare errno. + 2003-01-09 Ken Raeburn * telnetd.c (main): Use socklen_t when passing address to socket diff --git a/src/appl/telnet/telnetd/telnetd.h b/src/appl/telnet/telnetd/telnetd.h index 234b9739e..f21f617e5 100644 --- a/src/appl/telnet/telnetd/telnetd.h +++ b/src/appl/telnet/telnetd/telnetd.h @@ -45,5 +45,4 @@ /* other external variables */ extern char **environ; -extern int errno; diff --git a/src/kadmin/dbutil/ChangeLog b/src/kadmin/dbutil/ChangeLog index 5f32c1eee..711302500 100644 --- a/src/kadmin/dbutil/ChangeLog +++ b/src/kadmin/dbutil/ChangeLog @@ -1,3 +1,7 @@ +2003-04-23 Ken Raeburn + + * kdb5_destroy.c, kdb5_stash.c: Don't declare errno. + 2003-01-07 Ken Raeburn * Makefile.ov: Deleted. diff --git a/src/kadmin/dbutil/kdb5_destroy.c b/src/kadmin/dbutil/kdb5_destroy.c index 62d65ed49..2545bdb5d 100644 --- a/src/kadmin/dbutil/kdb5_destroy.c +++ b/src/kadmin/dbutil/kdb5_destroy.c @@ -36,7 +36,6 @@ #include #include "kdb5_util.h" -extern int errno; extern int exit_status; extern krb5_boolean dbactive; extern kadm5_config_params global_params; diff --git a/src/kadmin/dbutil/kdb5_stash.c b/src/kadmin/dbutil/kdb5_stash.c index 37db048ac..6d7251541 100644 --- a/src/kadmin/dbutil/kdb5_stash.c +++ b/src/kadmin/dbutil/kdb5_stash.c @@ -59,8 +59,6 @@ #include #include "kdb5_util.h" -extern int errno; - extern krb5_keyblock master_keyblock; extern krb5_principal master_princ; extern kadm5_config_params global_params; diff --git a/src/lib/des425/ChangeLog b/src/lib/des425/ChangeLog index acd4ea66e..9ab878a94 100644 --- a/src/lib/des425/ChangeLog +++ b/src/lib/des425/ChangeLog @@ -1,3 +1,8 @@ +2003-04-23 Ken Raeburn + + * quad_cksum.c, t_pcbc.c, t_quad.c, verify.c: Don't declare errno + or errmsg. + 2003-03-06 Alexandra Ellwood * mac_des_glue.c, des.c, enc_dec.c, key_sched.c, str_to_key.c: diff --git a/src/lib/des425/quad_cksum.c b/src/lib/des425/quad_cksum.c index b9ef031ef..2a7b78cfd 100644 --- a/src/lib/des425/quad_cksum.c +++ b/src/lib/des425/quad_cksum.c @@ -119,10 +119,6 @@ #define vaxtohs(x) two_bytes_vax_to_nets(((const unsigned char *)(x))) /* Externals */ -extern char *errmsg(); -#ifndef HAVE_ERRNO -extern int errno; -#endif extern int des_debug; /*** Routines ***************************************************** */ diff --git a/src/lib/des425/t_pcbc.c b/src/lib/des425/t_pcbc.c index 8bd6a08bc..2932148b7 100644 --- a/src/lib/des425/t_pcbc.c +++ b/src/lib/des425/t_pcbc.c @@ -30,8 +30,6 @@ #include "des_int.h" #include "des.h" -extern char *errmsg(); -extern int errno; char *progname; int des_debug; diff --git a/src/lib/des425/t_quad.c b/src/lib/des425/t_quad.c index 421a55584..b9299fd20 100644 --- a/src/lib/des425/t_quad.c +++ b/src/lib/des425/t_quad.c @@ -30,8 +30,6 @@ #include "des_int.h" #include "des.h" -extern char *errmsg(); -extern int errno; extern unsigned long quad_cksum(); char *progname; int des_debug; diff --git a/src/lib/des425/verify.c b/src/lib/des425/verify.c index 91718e350..653730a2f 100644 --- a/src/lib/des425/verify.c +++ b/src/lib/des425/verify.c @@ -37,8 +37,6 @@ #include "des_int.h" #include "des.h" -extern char *errmsg(); -extern int errno; char *progname; int nflag = 2; int vflag; diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog index 725db86bc..279ec8adb 100644 --- a/src/lib/rpc/ChangeLog +++ b/src/lib/rpc/ChangeLog @@ -1,3 +1,10 @@ +2003-04-23 Ken Raeburn + + * bindresvport.c: Include errno.h. + (gssrpc_bindresvport): Don't declare errno. + * clnt_tcp.c: Don't declare errno. + * svc.c: Don't declare errno. Include errno.h. + 2003-03-24 Tom Yu * xdr_mem.c (xdrmem_create): Perform some additional size checks. diff --git a/src/lib/rpc/bindresvport.c b/src/lib/rpc/bindresvport.c index 36b3ed533..28017d6cf 100644 --- a/src/lib/rpc/bindresvport.c +++ b/src/lib/rpc/bindresvport.c @@ -41,6 +41,7 @@ static char sccsid[] = "@(#)bindresvport.c 2.2 88/07/29 4.0 RPCSRC 1.8 88/02/08 #include #include #include +#include /* * Bind a socket to a privileged IP port @@ -53,7 +54,6 @@ gssrpc_bindresvport(sd, sockin) int res; static short port; struct sockaddr_in myaddr; - extern int errno; int i; #define STARTPORT 600 diff --git a/src/lib/rpc/clnt_tcp.c b/src/lib/rpc/clnt_tcp.c index abadf339c..9906bca0e 100644 --- a/src/lib/rpc/clnt_tcp.c +++ b/src/lib/rpc/clnt_tcp.c @@ -60,8 +60,6 @@ static char sccsid[] = "@(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro"; #define MCALL_MSG_SIZE 24 -extern int errno; - static enum clnt_stat clnttcp_call(CLIENT *, rpc_u_int32, xdrproc_t, void *, xdrproc_t, void *, struct timeval); static void clnttcp_abort(CLIENT *); diff --git a/src/lib/rpc/svc.c b/src/lib/rpc/svc.c index 7429acda1..902681541 100644 --- a/src/lib/rpc/svc.c +++ b/src/lib/rpc/svc.c @@ -46,8 +46,7 @@ static char sccsid[] = "@(#)svc.c 1.41 87/10/13 Copyr 1984 Sun Micro"; #include #include #include - -extern int errno; +#include #ifdef FD_SETSIZE static SVCXPRT **xports; diff --git a/src/util/et/ChangeLog b/src/util/et/ChangeLog index 1aaaf6ca2..493ce9ae3 100644 --- a/src/util/et/ChangeLog +++ b/src/util/et/ChangeLog @@ -1,3 +1,9 @@ +2003-04-23 Ken Raeburn + + * compile_et.c: Don't declare malloc or errno. Include stdlib.h + and errno.h. + * test_et.c: Don't declare errno or sys_nerr. + 2003-03-06 Alexandra Ellwood * com_err.c, com_err.h, error_message.c, et_c.awk, et_h.awk: Removed Mac OS 9-specific code. diff --git a/src/util/et/compile_et.c b/src/util/et/compile_et.c index 23771a0a7..dfaad5f57 100644 --- a/src/util/et/compile_et.c +++ b/src/util/et/compile_et.c @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include "mit-sipb-copyright.h" #include "compiler.h" @@ -27,10 +29,6 @@ char buffer[BUFSIZ]; char *table_name = (char *)NULL; FILE *hfile, *cfile; -/* C library */ -extern char *malloc(); -extern int errno; - /* lex stuff */ extern FILE *yyin; extern int yylineno; diff --git a/src/util/et/test_et.c b/src/util/et/test_et.c index 41ac394d5..57ebafd69 100644 --- a/src/util/et/test_et.c +++ b/src/util/et/test_et.c @@ -4,8 +4,6 @@ #include "test1.h" #include "test2.h" -extern int sys_nerr, errno; - /* XXX Not part of official public API. */ extern const char *error_table_name (errcode_t); diff --git a/src/util/ss/ChangeLog b/src/util/ss/ChangeLog index 15d6edc6a..66c86c764 100644 --- a/src/util/ss/ChangeLog +++ b/src/util/ss/ChangeLog @@ -1,3 +1,7 @@ +2003-04-23 Ken Raeburn + + * ss.h: Don't declare errno. Include errno.h. + 2003-02-05 Ken Raeburn * Makefile.in (std_rqs.c): Depend on ct_c.sed and ct_c.awk. diff --git a/src/util/ss/ss.h b/src/util/ss/ss.h index b2fd21f00..062003d3c 100644 --- a/src/util/ss/ss.h +++ b/src/util/ss/ss.h @@ -7,10 +7,9 @@ #ifndef _ss_h #define _ss_h __FILE__ +#include #include -extern int errno; - #ifdef __STDC__ #define __SS_CONST const #define __SS_PROTO (int, const char * const *, int, void *) -- 2.26.2