aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-07-25 22:35:34 +0100
committerDan Pasanen <dan.pasanen@gmail.com>2014-10-02 14:25:24 -0500
commita02fbffce9029e3eaa63dfc5f3e79a79da033e4c (patch)
tree0a1172936b3668f01e20fa2874251810b9f32384
parentc6e37862a742387dafd6e175c6d9cb38df5f81e3 (diff)
downloadandroid_external_bash-a02fbffce9029e3eaa63dfc5f3e79a79da033e4c.tar.gz
android_external_bash-a02fbffce9029e3eaa63dfc5f3e79a79da033e4c.tar.bz2
android_external_bash-a02fbffce9029e3eaa63dfc5f3e79a79da033e4c.zip
Fix building with 4.3's bionic
Change-Id: Icbbcf959deb199e7e584642027ea0383f6450fdc Conflicts: autom4te.cache/output.0 examples/loadables/getconf.c
-rw-r--r--CWRU/misc/hpux10-dlfcn.h2
-rw-r--r--aclocal.m42
-rw-r--r--bashhist.c2
-rw-r--r--builtins/bind.c2
-rw-r--r--builtins/bind.def2
-rw-r--r--builtins/caller.c2
-rw-r--r--builtins/caller.def2
-rw-r--r--builtins/cd.c2
-rw-r--r--builtins/cd.def2
-rw-r--r--builtins/common.c2
-rw-r--r--builtins/evalfile.c2
-rw-r--r--builtins/evalstring.c2
-rw-r--r--builtins/exec.c2
-rw-r--r--builtins/exec.def2
-rw-r--r--builtins/fc.c2
-rw-r--r--builtins/fc.def2
-rw-r--r--builtins/help.c2
-rw-r--r--builtins/help.def2
-rw-r--r--builtins/history.c2
-rw-r--r--builtins/history.def2
-rw-r--r--builtins/kill.c2
-rw-r--r--builtins/kill.def2
-rw-r--r--builtins/mapfile.c2
-rw-r--r--builtins/mapfile.def2
-rw-r--r--builtins/mkbuiltins.c2
-rw-r--r--builtins/printf.c2
-rw-r--r--builtins/printf.def2
-rw-r--r--builtins/psize.c2
-rw-r--r--builtins/pushd.c2
-rw-r--r--builtins/pushd.def2
-rw-r--r--builtins/read.c2
-rw-r--r--builtins/read.def2
-rw-r--r--builtins/source.c2
-rw-r--r--builtins/source.def2
-rw-r--r--builtins/ulimit.c2
-rw-r--r--builtins/ulimit.def2
-rwxr-xr-xconfigure2
-rw-r--r--error.c2
-rw-r--r--examples/loadables/cat.c2
-rw-r--r--examples/loadables/head.c2
-rw-r--r--examples/loadables/ln.c2
-rw-r--r--examples/loadables/logname.c2
-rw-r--r--examples/loadables/mkdir.c2
-rw-r--r--examples/loadables/pathchk.c2
-rw-r--r--examples/loadables/perl/bperl.c2
-rw-r--r--examples/loadables/print.c2
-rw-r--r--examples/loadables/push.c2
-rw-r--r--examples/loadables/rmdir.c2
-rw-r--r--examples/loadables/tee.c2
-rw-r--r--examples/loadables/template.c2
-rw-r--r--examples/loadables/uname.c2
-rw-r--r--examples/loadables/unlink.c2
-rw-r--r--execute_cmd.c2
-rw-r--r--findcmd.c2
-rw-r--r--general.c2
-rw-r--r--input.c2
-rw-r--r--jobs.c2
-rw-r--r--lib/intl/dcigettext.c2
-rw-r--r--lib/readline/bind.c2
-rw-r--r--lib/readline/complete.c2
-rw-r--r--lib/readline/examples/rlcat.c2
-rw-r--r--lib/readline/histfile.c2
-rw-r--r--lib/readline/input.c2
-rw-r--r--lib/readline/readline.c2
-rw-r--r--lib/readline/rltty.c2
-rw-r--r--lib/sh/eaccess.c2
-rw-r--r--lib/sh/fmtulong.c2
-rw-r--r--lib/sh/getcwd.c2
-rw-r--r--lib/sh/getenv.c2
-rw-r--r--lib/sh/input_avail.c2
-rw-r--r--lib/sh/netopen.c2
-rw-r--r--lib/sh/oslib.c2
-rw-r--r--lib/sh/pathcanon.c2
-rw-r--r--lib/sh/pathphys.c2
-rw-r--r--lib/sh/rename.c2
-rw-r--r--lib/sh/strerror.c2
-rw-r--r--lib/sh/strtod.c2
-rw-r--r--lib/sh/strtol.c2
-rw-r--r--lib/sh/tmpfile.c2
-rw-r--r--lib/sh/winsize.c2
-rw-r--r--lib/sh/zcatfd.c2
-rw-r--r--lib/sh/zgetline.c2
-rw-r--r--lib/sh/zmapfd.c2
-rw-r--r--lib/sh/zread.c2
-rw-r--r--lib/sh/zwrite.c2
-rw-r--r--locale.c2
-rw-r--r--mksyntax.c2
-rw-r--r--nojobs.c2
-rw-r--r--parse.y2
-rw-r--r--redir.c2
-rw-r--r--shell.c2
-rw-r--r--subst.c2
-rw-r--r--support/xcase.c2
-rw-r--r--test.c2
-rw-r--r--trap.c2
-rw-r--r--y.tab.c2
96 files changed, 96 insertions, 96 deletions
diff --git a/CWRU/misc/hpux10-dlfcn.h b/CWRU/misc/hpux10-dlfcn.h
index 49d4428..d5c35eb 100644
--- a/CWRU/misc/hpux10-dlfcn.h
+++ b/CWRU/misc/hpux10-dlfcn.h
@@ -43,7 +43,7 @@
#include <errno.h>
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
#define RTLD_LAZY BIND_DEFERRED
diff --git a/aclocal.m4 b/aclocal.m4
index a947272..eeee663 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1972,7 +1972,7 @@ AC_CACHE_VAL(bash_cv_wcontinued_broken,
#include <errno.h>
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
main()
{
diff --git a/bashhist.c b/bashhist.c
index d4c62e7..3f7a10b 100644
--- a/bashhist.c
+++ b/bashhist.c
@@ -60,7 +60,7 @@ extern int rl_done, rl_dispatching; /* should really include readline.h */
#endif
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
static int histignore_item_func __P((struct ign *));
diff --git a/builtins/bind.c b/builtins/bind.c
index 4bef721..dcacb5b 100644
--- a/builtins/bind.c
+++ b/builtins/bind.c
@@ -17,7 +17,7 @@
#include <stdio.h>
#include <errno.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
#include <readline/readline.h>
diff --git a/builtins/bind.def b/builtins/bind.def
index 3a7cc4e..7589ab8 100644
--- a/builtins/bind.def
+++ b/builtins/bind.def
@@ -73,7 +73,7 @@ $END
#include <stdio.h>
#include <errno.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
#include <readline/readline.h>
diff --git a/builtins/caller.c b/builtins/caller.c
index e9db7b2..e40b107 100644
--- a/builtins/caller.c
+++ b/builtins/caller.c
@@ -29,7 +29,7 @@
#endif
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
int
diff --git a/builtins/caller.def b/builtins/caller.def
index 965676b..d4443d9 100644
--- a/builtins/caller.def
+++ b/builtins/caller.def
@@ -65,7 +65,7 @@ $END
#endif
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
int
diff --git a/builtins/cd.c b/builtins/cd.c
index 7f9b13f..e2289ab 100644
--- a/builtins/cd.c
+++ b/builtins/cd.c
@@ -32,7 +32,7 @@
#include "bashgetopt.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
extern int posixly_correct;
diff --git a/builtins/cd.def b/builtins/cd.def
index f66e68c..e49b3bd 100644
--- a/builtins/cd.def
+++ b/builtins/cd.def
@@ -51,7 +51,7 @@ $PRODUCES cd.c
#include "bashgetopt.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
extern int posixly_correct;
diff --git a/builtins/common.c b/builtins/common.c
index fb2b38c..5f8a1e1 100644
--- a/builtins/common.c
+++ b/builtins/common.c
@@ -64,7 +64,7 @@
#endif
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
extern int indirection_level, subshell_environment;
diff --git a/builtins/evalfile.c b/builtins/evalfile.c
index 058d99d..50d3254 100644
--- a/builtins/evalfile.c
+++ b/builtins/evalfile.c
@@ -52,7 +52,7 @@
#include "common.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
/* Flags for _evalfile() */
diff --git a/builtins/evalstring.c b/builtins/evalstring.c
index 21937ba..91b22fe 100644
--- a/builtins/evalstring.c
+++ b/builtins/evalstring.c
@@ -55,7 +55,7 @@
#include "builtext.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
#define IS_BUILTIN(s) (builtin_address_internal(s, 0) != (struct builtin *)NULL)
diff --git a/builtins/exec.c b/builtins/exec.c
index fac53d2..88da13b 100644
--- a/builtins/exec.c
+++ b/builtins/exec.c
@@ -33,7 +33,7 @@
/* Not all systems declare ERRNO in errno.h... and some systems #define it! */
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
extern int subshell_environment;
diff --git a/builtins/exec.def b/builtins/exec.def
index 9cf76d5..16846ac 100644
--- a/builtins/exec.def
+++ b/builtins/exec.def
@@ -71,7 +71,7 @@ $END
/* Not all systems declare ERRNO in errno.h... and some systems #define it! */
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
extern int subshell_environment;
diff --git a/builtins/fc.c b/builtins/fc.c
index 89a1144..58d339c 100644
--- a/builtins/fc.c
+++ b/builtins/fc.c
@@ -36,7 +36,7 @@
#include "common.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
extern int current_command_line_count;
diff --git a/builtins/fc.def b/builtins/fc.def
index cf6b72c..1820826 100644
--- a/builtins/fc.def
+++ b/builtins/fc.def
@@ -82,7 +82,7 @@ $END
#include "common.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
extern int current_command_line_count;
diff --git a/builtins/help.c b/builtins/help.c
index 2b744fe..42c80e5 100644
--- a/builtins/help.c
+++ b/builtins/help.c
@@ -31,7 +31,7 @@
#include <glob/glob.h>
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
extern const char * const bash_copyright;
diff --git a/builtins/help.def b/builtins/help.def
index 1894f17..4f04305 100644
--- a/builtins/help.def
+++ b/builtins/help.def
@@ -71,7 +71,7 @@ $END
#include <glob/glob.h>
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
extern const char * const bash_copyright;
diff --git a/builtins/history.c b/builtins/history.c
index 92b2f5e..d7fc06f 100644
--- a/builtins/history.c
+++ b/builtins/history.c
@@ -28,7 +28,7 @@
#include "common.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
extern int current_command_line_count;
diff --git a/builtins/history.def b/builtins/history.def
index 4cf7308..7d04998 100644
--- a/builtins/history.def
+++ b/builtins/history.def
@@ -80,7 +80,7 @@ $END
#include "common.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
extern int current_command_line_count;
diff --git a/builtins/kill.c b/builtins/kill.c
index b49ed87..2b7e0c7 100644
--- a/builtins/kill.c
+++ b/builtins/kill.c
@@ -26,7 +26,7 @@
/* Not all systems declare ERRNO in errno.h... and some systems #define it! */
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
extern int posixly_correct;
diff --git a/builtins/kill.def b/builtins/kill.def
index 2e68f03..9024535 100644
--- a/builtins/kill.def
+++ b/builtins/kill.def
@@ -66,7 +66,7 @@ $END
/* Not all systems declare ERRNO in errno.h... and some systems #define it! */
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
extern int posixly_correct;
diff --git a/builtins/mapfile.c b/builtins/mapfile.c
index 4d03860..3a51a68 100644
--- a/builtins/mapfile.c
+++ b/builtins/mapfile.c
@@ -26,7 +26,7 @@
#include "bashgetopt.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
#if defined (ARRAY_VARS)
diff --git a/builtins/mapfile.def b/builtins/mapfile.def
index 2e6a643..f640ed4 100644
--- a/builtins/mapfile.def
+++ b/builtins/mapfile.def
@@ -84,7 +84,7 @@ $END
#include "bashgetopt.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
#if defined (ARRAY_VARS)
diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c
index 15bb80f..e5177b2 100644
--- a/builtins/mkbuiltins.c
+++ b/builtins/mkbuiltins.c
@@ -56,7 +56,7 @@
#define DOCFILE "builtins.texi"
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
static char *xmalloc (), *xrealloc ();
diff --git a/builtins/printf.c b/builtins/printf.c
index ba0fc1b..e4e2bca 100644
--- a/builtins/printf.c
+++ b/builtins/printf.c
@@ -54,7 +54,7 @@
#endif
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
#define PC(c) \
diff --git a/builtins/printf.def b/builtins/printf.def
index 7f29126..0e7fe78 100644
--- a/builtins/printf.def
+++ b/builtins/printf.def
@@ -104,7 +104,7 @@ $END
#endif
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
#define PC(c) \
diff --git a/builtins/psize.c b/builtins/psize.c
index 30881fb..0afe799 100644
--- a/builtins/psize.c
+++ b/builtins/psize.c
@@ -42,7 +42,7 @@
#include "../sig.h"
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
int nw;
diff --git a/builtins/pushd.c b/builtins/pushd.c
index 032c5b2..0185450 100644
--- a/builtins/pushd.c
+++ b/builtins/pushd.c
@@ -39,7 +39,7 @@
#endif
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
/* The list of remembered directories. */
diff --git a/builtins/pushd.def b/builtins/pushd.def
index 9c6548f..aca74ef 100644
--- a/builtins/pushd.def
+++ b/builtins/pushd.def
@@ -143,7 +143,7 @@ $END
#endif
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
/* The list of remembered directories. */
diff --git a/builtins/read.c b/builtins/read.c
index 9e4d455..2639042 100644
--- a/builtins/read.c
+++ b/builtins/read.c
@@ -44,7 +44,7 @@
#include "shmbutil.h"
#if !defined(errno)
-extern int errno;
+#include <errno.h>
#endif
extern void run_pending_traps __P((void));
diff --git a/builtins/read.def b/builtins/read.def
index 4397154..d6e5b4b 100644
--- a/builtins/read.def
+++ b/builtins/read.def
@@ -106,7 +106,7 @@ $END
#include "shmbutil.h"
#if !defined(errno)
-extern int errno;
+#include <errno.h>
#endif
extern void run_pending_traps __P((void));
diff --git a/builtins/source.c b/builtins/source.c
index d7eec21..6f280b8 100644
--- a/builtins/source.c
+++ b/builtins/source.c
@@ -30,7 +30,7 @@
#include "../trap.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
extern int posixly_correct;
diff --git a/builtins/source.def b/builtins/source.def
index 71908b8..a6027ca 100644
--- a/builtins/source.def
+++ b/builtins/source.def
@@ -76,7 +76,7 @@ $END
#include "../trap.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
extern int posixly_correct;
diff --git a/builtins/ulimit.c b/builtins/ulimit.c
index ab016d1..b57c627 100644
--- a/builtins/ulimit.c
+++ b/builtins/ulimit.c
@@ -27,7 +27,7 @@
#include "pipesize.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
/* For some reason, HPUX chose to make these definitions visible only if
diff --git a/builtins/ulimit.def b/builtins/ulimit.def
index e551cff..fc676c7 100644
--- a/builtins/ulimit.def
+++ b/builtins/ulimit.def
@@ -92,7 +92,7 @@ $END
#include "pipesize.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
/* For some reason, HPUX chose to make these definitions visible only if
diff --git a/configure b/configure
index 98bf890..14eebda 100755
--- a/configure
+++ b/configure
@@ -15348,7 +15348,7 @@ else
#include <errno.h>
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
main()
{
diff --git a/error.c b/error.c
index 64c4f41..597fc20 100644
--- a/error.c
+++ b/error.c
@@ -37,7 +37,7 @@
#include <errno.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
#include "bashansi.h"
diff --git a/examples/loadables/cat.c b/examples/loadables/cat.c
index 1ce2e2d..30fe789 100644
--- a/examples/loadables/cat.c
+++ b/examples/loadables/cat.c
@@ -29,7 +29,7 @@
#include "shell.h"
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
extern char *strerror ();
diff --git a/examples/loadables/head.c b/examples/loadables/head.c
index 22cf6ab..ac93f78 100644
--- a/examples/loadables/head.c
+++ b/examples/loadables/head.c
@@ -42,7 +42,7 @@
#include "common.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
static void
diff --git a/examples/loadables/ln.c b/examples/loadables/ln.c
index ec73636..16514ee 100644
--- a/examples/loadables/ln.c
+++ b/examples/loadables/ln.c
@@ -39,7 +39,7 @@
#include "common.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
typedef int unix_link_syscall_t __P((const char *, const char *));
diff --git a/examples/loadables/logname.c b/examples/loadables/logname.c
index 95b7e21..c3d2538 100644
--- a/examples/loadables/logname.c
+++ b/examples/loadables/logname.c
@@ -32,7 +32,7 @@
#include "common.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
logname_builtin (list)
diff --git a/examples/loadables/mkdir.c b/examples/loadables/mkdir.c
index f5c105e..ba83991 100644
--- a/examples/loadables/mkdir.c
+++ b/examples/loadables/mkdir.c
@@ -37,7 +37,7 @@
#include "common.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
#define ISOCTAL(c) ((c) >= '0' && (c) <= '7')
diff --git a/examples/loadables/pathchk.c b/examples/loadables/pathchk.c
index c5fd24a..6c510e1 100644
--- a/examples/loadables/pathchk.c
+++ b/examples/loadables/pathchk.c
@@ -66,7 +66,7 @@
#include "common.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
#if !defined (_POSIX_PATH_MAX)
diff --git a/examples/loadables/perl/bperl.c b/examples/loadables/perl/bperl.c
index 77e3f7c..c12fd7a 100644
--- a/examples/loadables/perl/bperl.c
+++ b/examples/loadables/perl/bperl.c
@@ -10,7 +10,7 @@
#include "shell.h"
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
extern char **make_builtin_argv ();
diff --git a/examples/loadables/print.c b/examples/loadables/print.c
index e17597b..fa22bf7 100644
--- a/examples/loadables/print.c
+++ b/examples/loadables/print.c
@@ -39,7 +39,7 @@
#include "common.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
int print_builtin ();
diff --git a/examples/loadables/push.c b/examples/loadables/push.c
index b076073..ca5de75 100644
--- a/examples/loadables/push.c
+++ b/examples/loadables/push.c
@@ -32,7 +32,7 @@
#include "common.h"
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
extern int dollar_dollar_pid;
diff --git a/examples/loadables/rmdir.c b/examples/loadables/rmdir.c
index 0cfe6c7..5d7bf8c 100644
--- a/examples/loadables/rmdir.c
+++ b/examples/loadables/rmdir.c
@@ -29,7 +29,7 @@
#include "common.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
rmdir_builtin (list)
diff --git a/examples/loadables/tee.c b/examples/loadables/tee.c
index 8b5715f..2f7e4d0 100644
--- a/examples/loadables/tee.c
+++ b/examples/loadables/tee.c
@@ -43,7 +43,7 @@
#include "common.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
typedef struct flist {
diff --git a/examples/loadables/template.c b/examples/loadables/template.c
index 3a5814f..d8ee271 100644
--- a/examples/loadables/template.c
+++ b/examples/loadables/template.c
@@ -16,7 +16,7 @@
#include "bashgetopt.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
extern char *strerror ();
diff --git a/examples/loadables/uname.c b/examples/loadables/uname.c
index a1bddd5..14a9bbb 100644
--- a/examples/loadables/uname.c
+++ b/examples/loadables/uname.c
@@ -56,7 +56,7 @@ struct utsname {
#define FLAG_ALL 0x1f
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
static void uprint();
diff --git a/examples/loadables/unlink.c b/examples/loadables/unlink.c
index 07e3f3d..3c829e3 100644
--- a/examples/loadables/unlink.c
+++ b/examples/loadables/unlink.c
@@ -35,7 +35,7 @@
#include "common.h"
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
unlink_builtin (list)
diff --git a/execute_cmd.c b/execute_cmd.c
index 9cebaef..c8564a5 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -54,7 +54,7 @@
#include <errno.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
#define NEED_FPURGE_DECL
diff --git a/findcmd.c b/findcmd.c
index 9f3d954..0aa1f61 100644
--- a/findcmd.c
+++ b/findcmd.c
@@ -45,7 +45,7 @@
#include "findcmd.h" /* matching prototypes and declarations */
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
extern int posixly_correct;
diff --git a/general.c b/general.c
index 087689e..fba66a5 100644
--- a/general.c
+++ b/general.c
@@ -45,7 +45,7 @@
#include <tilde/tilde.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
extern int expand_aliases;
diff --git a/input.c b/input.c
index 14c6f4e..ea2e407 100644
--- a/input.c
+++ b/input.c
@@ -45,7 +45,7 @@
#include "trap.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
#if defined (EAGAIN)
diff --git a/jobs.c b/jobs.c
index f38b0c3..baa8614 100644
--- a/jobs.c
+++ b/jobs.c
@@ -76,7 +76,7 @@
#include "builtins/common.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
#if !defined (HAVE_KILLPG)
diff --git a/lib/intl/dcigettext.c b/lib/intl/dcigettext.c
index c0f347e..64b3875 100644
--- a/lib/intl/dcigettext.c
+++ b/lib/intl/dcigettext.c
@@ -55,7 +55,7 @@ char *alloca ();
#include <errno.h>
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
#ifndef __set_errno
# define __set_errno(val) errno = (val)
diff --git a/lib/readline/bind.c b/lib/readline/bind.c
index 8acf4ac..51978c7 100644
--- a/lib/readline/bind.c
+++ b/lib/readline/bind.c
@@ -49,7 +49,7 @@
#include <errno.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
#include "posixstat.h"
diff --git a/lib/readline/complete.c b/lib/readline/complete.c
index cd9aebe..544fc46 100644
--- a/lib/readline/complete.c
+++ b/lib/readline/complete.c
@@ -47,7 +47,7 @@
#include <errno.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
#if defined (HAVE_PWD_H)
diff --git a/lib/readline/examples/rlcat.c b/lib/readline/examples/rlcat.c
index fa9e06f..db03e87 100644
--- a/lib/readline/examples/rlcat.c
+++ b/lib/readline/examples/rlcat.c
@@ -46,7 +46,7 @@ extern void exit();
#endif
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
#if defined (READLINE_LIBRARY)
diff --git a/lib/readline/histfile.c b/lib/readline/histfile.c
index bb74315..845c243 100644
--- a/lib/readline/histfile.c
+++ b/lib/readline/histfile.c
@@ -90,7 +90,7 @@
#include <errno.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
#include "history.h"
diff --git a/lib/readline/input.c b/lib/readline/input.c
index f3f6d59..e5434f9 100644
--- a/lib/readline/input.c
+++ b/lib/readline/input.c
@@ -57,7 +57,7 @@
#include <errno.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
/* System-specific feature definitions and include files. */
diff --git a/lib/readline/readline.c b/lib/readline/readline.c
index abb29a0..50e4338 100644
--- a/lib/readline/readline.c
+++ b/lib/readline/readline.c
@@ -52,7 +52,7 @@
#include <errno.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
/* System-specific feature definitions and include files. */
diff --git a/lib/readline/rltty.c b/lib/readline/rltty.c
index 908bae1..faf4bc6 100644
--- a/lib/readline/rltty.c
+++ b/lib/readline/rltty.c
@@ -46,7 +46,7 @@
#include "rlprivate.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
rl_vintfunc_t *rl_prep_term_function = rl_prep_terminal;
diff --git a/lib/sh/eaccess.c b/lib/sh/eaccess.c
index 8132a9a..ccb2f22 100644
--- a/lib/sh/eaccess.c
+++ b/lib/sh/eaccess.c
@@ -34,7 +34,7 @@
#include <errno.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
#if !defined (_POSIX_VERSION) && defined (HAVE_SYS_FILE_H)
diff --git a/lib/sh/fmtulong.c b/lib/sh/fmtulong.c
index 0ccc22b..6feda41 100644
--- a/lib/sh/fmtulong.c
+++ b/lib/sh/fmtulong.c
@@ -51,7 +51,7 @@
#include <typemax.h>
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
#define x_digs "0123456789abcdef"
diff --git a/lib/sh/getcwd.c b/lib/sh/getcwd.c
index d7bd241..31e26b7 100644
--- a/lib/sh/getcwd.c
+++ b/lib/sh/getcwd.c
@@ -57,7 +57,7 @@
#include <xmalloc.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
#if !defined (HAVE_LSTAT)
diff --git a/lib/sh/getenv.c b/lib/sh/getenv.c
index 8b5e340..c86f861 100644
--- a/lib/sh/getenv.c
+++ b/lib/sh/getenv.c
@@ -32,7 +32,7 @@
#include <shell.h>
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
extern char **environ;
diff --git a/lib/sh/input_avail.c b/lib/sh/input_avail.c
index ac157a9..c2ecbc1 100644
--- a/lib/sh/input_avail.c
+++ b/lib/sh/input_avail.c
@@ -49,7 +49,7 @@
#include <errno.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
#if !defined (O_NDELAY) && defined (O_NONBLOCK)
diff --git a/lib/sh/netopen.c b/lib/sh/netopen.c
index 736d413..f82aaa6 100644
--- a/lib/sh/netopen.c
+++ b/lib/sh/netopen.c
@@ -59,7 +59,7 @@
#include <xmalloc.h>
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
#if !defined (HAVE_INET_ATON)
diff --git a/lib/sh/oslib.c b/lib/sh/oslib.c
index 65eb99d..bd48dd7 100644
--- a/lib/sh/oslib.c
+++ b/lib/sh/oslib.c
@@ -48,7 +48,7 @@
#include <shell.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
/* Make the functions strchr and strrchr if they do not exist. */
diff --git a/lib/sh/pathcanon.c b/lib/sh/pathcanon.c
index f19bd55..f9bd2d7 100644
--- a/lib/sh/pathcanon.c
+++ b/lib/sh/pathcanon.c
@@ -39,7 +39,7 @@
#include "shell.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
#if defined (__CYGWIN__)
diff --git a/lib/sh/pathphys.c b/lib/sh/pathphys.c
index 26016b7..783e8c5 100644
--- a/lib/sh/pathphys.c
+++ b/lib/sh/pathphys.c
@@ -43,7 +43,7 @@
#endif
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
extern char *get_working_directory __P((char *));
diff --git a/lib/sh/rename.c b/lib/sh/rename.c
index e410b5e..ef2c7fb 100644
--- a/lib/sh/rename.c
+++ b/lib/sh/rename.c
@@ -35,7 +35,7 @@
#include <stdc.h>
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
int
diff --git a/lib/sh/strerror.c b/lib/sh/strerror.c
index bf63926..e2b75b3 100644
--- a/lib/sh/strerror.c
+++ b/lib/sh/strerror.c
@@ -37,7 +37,7 @@
#include <shell.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
/* Return a string corresponding to the error number E. From
diff --git a/lib/sh/strtod.c b/lib/sh/strtod.c
index 851d99b..bd09981 100644
--- a/lib/sh/strtod.c
+++ b/lib/sh/strtod.c
@@ -26,7 +26,7 @@
#include <errno.h>
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
#include <chartypes.h>
diff --git a/lib/sh/strtol.c b/lib/sh/strtol.c
index 8aa7478..bf7985e 100644
--- a/lib/sh/strtol.c
+++ b/lib/sh/strtol.c
@@ -26,7 +26,7 @@
#include <errno.h>
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
#ifndef __set_errno
diff --git a/lib/sh/tmpfile.c b/lib/sh/tmpfile.c
index c06ad65..99ed5ca 100644
--- a/lib/sh/tmpfile.c
+++ b/lib/sh/tmpfile.c
@@ -39,7 +39,7 @@
#include <shell.h>
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
#define BASEOPENFLAGS (O_CREAT | O_TRUNC | O_EXCL | O_BINARY)
diff --git a/lib/sh/winsize.c b/lib/sh/winsize.c
index 64a9858..ad02075 100644
--- a/lib/sh/winsize.c
+++ b/lib/sh/winsize.c
@@ -60,7 +60,7 @@
#define input_tty() (shell_tty != -1) ? shell_tty : fileno (stderr)
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
extern int shell_tty;
diff --git a/lib/sh/zcatfd.c b/lib/sh/zcatfd.c
index bdbcd91..5c7bdc4 100644
--- a/lib/sh/zcatfd.c
+++ b/lib/sh/zcatfd.c
@@ -31,7 +31,7 @@
#include <stdc.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
extern ssize_t zread __P((int, char *, size_t));
diff --git a/lib/sh/zgetline.c b/lib/sh/zgetline.c
index 9cef975..30194b6 100644
--- a/lib/sh/zgetline.c
+++ b/lib/sh/zgetline.c
@@ -31,7 +31,7 @@
#include "xmalloc.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
extern ssize_t zread __P((int, char *, size_t));
diff --git a/lib/sh/zmapfd.c b/lib/sh/zmapfd.c
index e720892..02d1593 100644
--- a/lib/sh/zmapfd.c
+++ b/lib/sh/zmapfd.c
@@ -33,7 +33,7 @@
#include "general.h"
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
extern ssize_t zread __P((int, char *, size_t));
diff --git a/lib/sh/zread.c b/lib/sh/zread.c
index 868f970..2c4b8f6 100644
--- a/lib/sh/zread.c
+++ b/lib/sh/zread.c
@@ -30,7 +30,7 @@
#include <errno.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
#ifndef SEEK_CUR
diff --git a/lib/sh/zwrite.c b/lib/sh/zwrite.c
index 3240f4f..b260572 100644
--- a/lib/sh/zwrite.c
+++ b/lib/sh/zwrite.c
@@ -29,7 +29,7 @@
#include <errno.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
/* Write NB bytes from BUF to file descriptor FD, retrying the write if
diff --git a/locale.c b/locale.c
index 8dabc7d..9893d72 100644
--- a/locale.c
+++ b/locale.c
@@ -40,7 +40,7 @@
#include "input.h" /* For bash_input */
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
int locale_utf8locale; /* unused for now */
diff --git a/mksyntax.c b/mksyntax.c
index 0385686..449ff7c 100644
--- a/mksyntax.c
+++ b/mksyntax.c
@@ -37,7 +37,7 @@ extern int optind;
extern char *optarg;
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
#ifndef HAVE_STRERROR
diff --git a/nojobs.c b/nojobs.c
index 0c9bd75..189dc86 100644
--- a/nojobs.c
+++ b/nojobs.c
@@ -69,7 +69,7 @@
#define input_tty() (shell_tty != -1) ? shell_tty : fileno (stderr)
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
extern int interactive, interactive_shell, login_shell;
diff --git a/parse.y b/parse.y
index 7f92aea..c1cb0f9 100644
--- a/parse.y
+++ b/parse.y
@@ -129,7 +129,7 @@ extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin;
extern int bash_input_fd_changed;
#endif
-extern int errno;
+#include <errno.h>
/* **************************************************************** */
/* */
/* "Forward" declarations */
diff --git a/redir.c b/redir.c
index a4a3bb7..f38e0a2 100644
--- a/redir.c
+++ b/redir.c
@@ -39,7 +39,7 @@
#include <errno.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
#include "bashansi.h"
diff --git a/shell.c b/shell.c
index bbc8a66..8924642 100644
--- a/shell.c
+++ b/shell.c
@@ -88,7 +88,7 @@ extern struct passwd *getpwuid ();
#endif /* !HAVE_GETPW_DECLS */
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif
#if defined (NO_MAIN_ENV_ARG)
diff --git a/subst.c b/subst.c
index 9e8447a..6773331 100644
--- a/subst.c
+++ b/subst.c
@@ -63,7 +63,7 @@
#include <glob/strmatch.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
/* The size that strings change by. */
diff --git a/support/xcase.c b/support/xcase.c
index 6796e06..be50bd1 100644
--- a/support/xcase.c
+++ b/support/xcase.c
@@ -33,7 +33,7 @@
#include <errno.h>
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
#define LOWER 1
diff --git a/test.c b/test.c
index ab7bec7..75f1edf 100644
--- a/test.c
+++ b/test.c
@@ -42,7 +42,7 @@
#include <errno.h>
#if !defined (errno)
-extern int errno;
+#include <errno.h>
#endif /* !errno */
#if !defined (_POSIX_VERSION) && defined (HAVE_SYS_FILE_H)
diff --git a/trap.c b/trap.c
index edce31a..d1cdedf 100644
--- a/trap.c
+++ b/trap.c
@@ -52,7 +52,7 @@
#endif
#ifndef errno
-extern int errno;
+#include <errno.h>
#endif
/* Flags which describe the current handling state of a signal. */
diff --git a/y.tab.c b/y.tab.c
index bb2dad1..95ff2b0 100644
--- a/y.tab.c
+++ b/y.tab.c
@@ -280,7 +280,7 @@ extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin;
extern int bash_input_fd_changed;
#endif
-extern int errno;
+#include <errno.h>
/* **************************************************************** */
/* */
/* "Forward" declarations */