From 4885712264980e6cbc2039f9158027bee9213475 Mon Sep 17 00:00:00 2001 From: Glenn Burkhardt Date: Tue, 30 Sep 2003 16:57:26 +0000 Subject: [PATCH] [bug #4302] errno is not always an extern int The errno declaration is best left to errno.h; several systems use #define errno (*(___errno())) or similar --- sbr/context_read.c | 2 -- sbr/lock_file.c | 2 -- sbr/m_draft.c | 2 -- sbr/makedir.c | 2 -- sbr/mts.c | 2 -- sbr/ruserpass.c | 1 - uip/annosbr.c | 1 - uip/dropsbr.c | 2 -- uip/folder.c | 2 -- uip/inc.c | 2 -- uip/mhbuild.c | 2 -- uip/mhbuildsbr.c | 2 -- uip/mhcachesbr.c | 2 -- uip/mhfree.c | 2 -- uip/mhlist.c | 2 -- uip/mhlistsbr.c | 2 -- uip/mhmisc.c | 1 - uip/mhn.c | 2 -- uip/mhoutsbr.c | 1 - uip/mhparse.c | 1 - uip/mhshow.c | 2 -- uip/mhshowsbr.c | 1 - uip/mhstore.c | 2 -- uip/mhstoresbr.c | 1 - uip/mhtest.c | 2 -- uip/mshcmds.c | 2 -- uip/packf.c | 2 -- uip/popi.c | 1 - uip/prompter.c | 1 - uip/rcvstore.c | 1 - uip/refile.c | 2 -- uip/scan.c | 1 - uip/send.c | 1 - uip/viamail.c | 1 - uip/vmh.c | 1 - uip/wmh.c | 1 - 36 files changed, 57 deletions(-) diff --git a/sbr/context_read.c b/sbr/context_read.c index c3fe599..3084ff5 100644 --- a/sbr/context_read.c +++ b/sbr/context_read.c @@ -28,8 +28,6 @@ #include /* system call errors */ #include /* structure for getpwuid() results */ -extern int errno; /* system call error number */ - void context_read (void) { diff --git a/sbr/lock_file.c b/sbr/lock_file.c index c088283..6deddd4 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -56,8 +56,6 @@ #include #endif -extern int errno; - #ifdef LOCKDIR char *lockdir = LOCKDIR; #endif diff --git a/sbr/m_draft.c b/sbr/m_draft.c index 6782c34..7aea6f0 100644 --- a/sbr/m_draft.c +++ b/sbr/m_draft.c @@ -12,8 +12,6 @@ #include #include -extern int errno; - char * m_draft (char *folder, char *msg, int use, int *isdf) diff --git a/sbr/makedir.c b/sbr/makedir.c index 523feb6..c5332ca 100644 --- a/sbr/makedir.c +++ b/sbr/makedir.c @@ -17,8 +17,6 @@ #include #include #include - -extern int errno; int makedir (char *dir) diff --git a/sbr/mts.c b/sbr/mts.c index 40d4e27..169894f 100644 --- a/sbr/mts.c +++ b/sbr/mts.c @@ -27,8 +27,6 @@ #define NOTOK (-1) #define OK 0 -extern int errno; - /* * static prototypes */ diff --git a/sbr/ruserpass.c b/sbr/ruserpass.c index 9e50da6..4c12b71 100644 --- a/sbr/ruserpass.c +++ b/sbr/ruserpass.c @@ -66,7 +66,6 @@ ruserpass(char *host, char **aname, char **apass) char *hdir, buf[BUFSIZ]; int t, usedefault = 0; struct stat stb; - extern int errno; hdir = getenv("HOME"); if (hdir == NULL) diff --git a/uip/annosbr.c b/uip/annosbr.c index 41b0cc2..1a2c989 100644 --- a/uip/annosbr.c +++ b/uip/annosbr.c @@ -14,7 +14,6 @@ #include #include -extern int errno; /* * static prototypes diff --git a/uip/dropsbr.c b/uip/dropsbr.c index 212d162..7f432ea 100644 --- a/uip/dropsbr.c +++ b/uip/dropsbr.c @@ -35,8 +35,6 @@ #include -extern int errno; - /* * static prototypes */ diff --git a/uip/folder.c b/uip/folder.c index 7706f90..e4779dc 100644 --- a/uip/folder.c +++ b/uip/folder.c @@ -66,8 +66,6 @@ static struct swit switches[] = { { NULL, 0 } }; -extern int errno; - static int fshort = 0; /* output only folder names */ static int fcreat = 0; /* should we ask to create new folders? */ static int fpack = 0; /* are we packing the folder? */ diff --git a/uip/inc.c b/uip/inc.c index 09cfa95..af8180d 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -134,8 +134,6 @@ static struct swit switches[] = { { NULL, 0 } }; -extern int errno; - /* * flags for the mail source */ diff --git a/uip/mhbuild.c b/uip/mhbuild.c index 2b0ad1a..b16e8c9 100644 --- a/uip/mhbuild.c +++ b/uip/mhbuild.c @@ -68,8 +68,6 @@ static struct swit switches[] = { }; -extern int errno; - /* mhbuildsbr.c */ extern int checksw; extern char *tmp; /* directory to place temp files */ diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index 58104a5..fb2d451 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -44,8 +44,6 @@ #endif -extern int errno; - extern int debugsw; extern int verbosw; diff --git a/uip/mhcachesbr.c b/uip/mhcachesbr.c index ece5943..56d3dcc 100644 --- a/uip/mhcachesbr.c +++ b/uip/mhcachesbr.c @@ -37,8 +37,6 @@ # include #endif - -extern int errno; extern int debugsw; extern pid_t xpid; /* mhshowsbr.c or mhbuildsbr.c */ diff --git a/uip/mhfree.c b/uip/mhfree.c index c43c5e9..9d064ba 100644 --- a/uip/mhfree.c +++ b/uip/mhfree.c @@ -15,8 +15,6 @@ #include #include -extern int errno; - /* * prototypes */ diff --git a/uip/mhlist.c b/uip/mhlist.c index 10ba1e4..4fc17dc 100644 --- a/uip/mhlist.c +++ b/uip/mhlist.c @@ -73,8 +73,6 @@ static struct swit switches[] = { }; -extern int errno; - /* mhparse.c */ extern int checksw; extern char *tmp; /* directory to place temp files */ diff --git a/uip/mhlistsbr.c b/uip/mhlistsbr.c index dd6d855..bce44d0 100644 --- a/uip/mhlistsbr.c +++ b/uip/mhlistsbr.c @@ -20,8 +20,6 @@ #include #include -extern int errno; - /* mhmisc.c */ int part_ok (CT, int); int type_ok (CT, int); diff --git a/uip/mhmisc.c b/uip/mhmisc.c index 2a1672e..825ec87 100644 --- a/uip/mhmisc.c +++ b/uip/mhmisc.c @@ -14,7 +14,6 @@ #include #include -extern int errno; extern int debugsw; /* diff --git a/uip/mhn.c b/uip/mhn.c index c6d5c77..55f06c4 100644 --- a/uip/mhn.c +++ b/uip/mhn.c @@ -131,8 +131,6 @@ static struct swit switches[] = { }; -extern int errno; - /* mhparse.c */ extern int checksw; extern char *tmp; /* directory to place temp files */ diff --git a/uip/mhoutsbr.c b/uip/mhoutsbr.c index 0c4c2be..fff4ccc 100644 --- a/uip/mhoutsbr.c +++ b/uip/mhoutsbr.c @@ -26,7 +26,6 @@ #endif -extern int errno; extern int ebcdicsw; static char ebcdicsafe[0x100] = { diff --git a/uip/mhparse.c b/uip/mhparse.c index 79997fd..0bb56da 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -26,7 +26,6 @@ #endif -extern int errno; extern int debugsw; extern int endian; /* mhmisc.c */ diff --git a/uip/mhshow.c b/uip/mhshow.c index 4496590..65f66f4 100644 --- a/uip/mhshow.c +++ b/uip/mhshow.c @@ -87,8 +87,6 @@ static struct swit switches[] = { }; -extern int errno; - /* mhparse.c */ extern int checksw; extern char *tmp; /* directory to place temp files */ diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index d7d4d14..1c786cc 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -35,7 +35,6 @@ # define siglongjmp(env,val) longjmp(env,val) #endif -extern int errno; extern int debugsw; int pausesw = 1; diff --git a/uip/mhstore.c b/uip/mhstore.c index 4bfc676..1529de9 100644 --- a/uip/mhstore.c +++ b/uip/mhstore.c @@ -69,8 +69,6 @@ static struct swit switches[] = { }; -extern int errno; - /* mhparse.c */ extern int checksw; extern char *tmp; /* directory to place temp files */ diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index 2e88df2..fc78ac1 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -21,7 +21,6 @@ #include #include -extern int errno; /* * The list of top-level contents to display diff --git a/uip/mhtest.c b/uip/mhtest.c index a7d2d38..46c86ac 100644 --- a/uip/mhtest.c +++ b/uip/mhtest.c @@ -67,8 +67,6 @@ static struct swit switches[] = { }; -extern int errno; - int ebcdicsw = 0; /* hack for linking purposes */ /* mhparse.c */ diff --git a/uip/mshcmds.c b/uip/mshcmds.c index 3548b7e..4566029 100644 --- a/uip/mshcmds.c +++ b/uip/mshcmds.c @@ -22,7 +22,6 @@ #include #include -extern int errno; static char delim3[] = "-------"; /* from burst.c */ @@ -3009,7 +3008,6 @@ process (int msgnum, char *proc, int vecp, char **vec) strncpy (tmpfil, m_scratch ("", invo_name), sizeof(tmpfil)); if ((out = fopen (tmpfil, "w")) == NULL) { int olderr; - extern int errno; char newfil[80]; olderr = errno; diff --git a/uip/packf.c b/uip/packf.c index a38f795..405a005 100644 --- a/uip/packf.c +++ b/uip/packf.c @@ -35,8 +35,6 @@ static struct swit switches[] = { { NULL, 0 } }; -extern int errno; - static int md = NOTOK; static int mbx_style = MBOX_FORMAT; static int mapping = 0; diff --git a/uip/popi.c b/uip/popi.c index afdd4fb..953db14 100644 --- a/uip/popi.c +++ b/uip/popi.c @@ -80,7 +80,6 @@ static char mailname[BUFSIZ]; static char *nfs = NULL; static struct msgs *mp; -extern int errno; extern char response[]; /* diff --git a/uip/prompter.c b/uip/prompter.c index bc194ff..fd10aca 100644 --- a/uip/prompter.c +++ b/uip/prompter.c @@ -64,7 +64,6 @@ static struct swit switches[] = { { NULL, 0 } }; -extern int errno; #ifdef HAVE_TERMIOS_H static struct termios tio; diff --git a/uip/rcvstore.c b/uip/rcvstore.c index 8f6a6f8..dd6dc88 100644 --- a/uip/rcvstore.c +++ b/uip/rcvstore.c @@ -42,7 +42,6 @@ static struct swit switches[] = { { NULL, 0 } }; -extern int errno; /* * name of temporary file to store incoming message diff --git a/uip/refile.c b/uip/refile.c index 663092b..c184dc1 100644 --- a/uip/refile.c +++ b/uip/refile.c @@ -51,8 +51,6 @@ static struct swit switches[] = { { NULL, 0 } }; -extern int errno; - static char maildir[BUFSIZ]; struct st_fold { diff --git a/uip/scan.c b/uip/scan.c index a53a5ba..02621dc 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -51,7 +51,6 @@ static struct swit switches[] = { { NULL, 0 } }; -extern int errno; /* * global for sbr/formatsbr.c - yech! diff --git a/uip/send.c b/uip/send.c index 1da9440..514f073 100644 --- a/uip/send.c +++ b/uip/send.c @@ -129,7 +129,6 @@ extern char *altmsg; /* .. */ extern char *annotext; extern char *distfile; -extern int errno; int main (int argc, char **argv) diff --git a/uip/viamail.c b/uip/viamail.c index b4cd5e2..3dbd27c 100644 --- a/uip/viamail.c +++ b/uip/viamail.c @@ -52,7 +52,6 @@ static struct swit switches[] = { { NULL, 0 } }; -extern int errno; extern int debugsw; extern int splitsw; extern int verbsw; diff --git a/uip/vmh.c b/uip/vmh.c index 8267f01..327f451 100644 --- a/uip/vmh.c +++ b/uip/vmh.c @@ -203,7 +203,6 @@ static RETSIGTYPE TSTPser(int); /* MISCELLANY */ -extern int errno; /* * static prototypes diff --git a/uip/wmh.c b/uip/wmh.c index c69363a..af06698 100644 --- a/uip/wmh.c +++ b/uip/wmh.c @@ -128,7 +128,6 @@ static struct tchars tc; #define WERASC ltc.t_werasc static struct ltchars ltc; -extern int errno; int ALRMser (), PIPEser (), SIGser (); int ADJser (), REFser (); -- 1.7.10.4