From fd0ca86dd2c3e7b349b9aae76e1dd5ba1c669ed6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 2 Aug 2004 22:41:37 +0000 Subject: (errno): Remove decl; we now assume C89 or better. --- lib/canonicalize.c | 10 +++------- lib/chown.c | 3 --- lib/closeout.c | 4 ---- lib/dup-safer.c | 3 --- lib/dup2.c | 3 --- lib/exclude.c | 3 --- lib/fopen-safer.c | 4 ---- lib/ftruncate.c | 3 --- lib/full-write.c | 3 --- lib/getcwd.c | 5 ----- lib/lchown.c | 4 +--- lib/memcoll.c | 4 ---- lib/putenv.c | 5 +---- lib/rmdir.c | 4 ---- lib/savedir.c | 3 --- lib/setenv.c | 5 +---- lib/stat.c | 3 --- lib/utime.c | 3 --- lib/xgetcwd.c | 4 ---- lib/xmemcoll.c | 4 ---- lib/xreadlink.c | 4 ---- 21 files changed, 6 insertions(+), 78 deletions(-) (limited to 'lib') diff --git a/lib/canonicalize.c b/lib/canonicalize.c index 02bea7c5a..6d1bfbc6f 100644 --- a/lib/canonicalize.c +++ b/lib/canonicalize.c @@ -50,10 +50,6 @@ void free (); #include "xalloc.h" #include "xgetcwd.h" -#ifndef errno -extern int errno; -#endif - #ifndef __set_errno # define __set_errno(Val) errno = (Val) #endif @@ -89,7 +85,7 @@ extern int errno; char * canonicalize_file_name (const char *name) { -#if HAVE_RESOLVEPATH +# if HAVE_RESOLVEPATH char *resolved, *extra_buf = NULL; size_t resolved_size; @@ -146,11 +142,11 @@ canonicalize_file_name (const char *name) return resolved; -#else +# else return canonicalize_filename_mode (name, CAN_EXISTING); -#endif /* !HAVE_RESOLVEPATH */ +# endif /* !HAVE_RESOLVEPATH */ } #endif /* !HAVE_CANONICALIZE_FILE_NAME */ diff --git a/lib/chown.c b/lib/chown.c index 460e4f623..d761c7339 100644 --- a/lib/chown.c +++ b/lib/chown.c @@ -36,9 +36,6 @@ # include #endif #include -#ifndef errno -extern int errno; -#endif /* Provide a more-closely POSIX-conforming version of chown on systems with one or both of the following problems: diff --git a/lib/closeout.c b/lib/closeout.c index a551d1ae8..1b0b50c29 100644 --- a/lib/closeout.c +++ b/lib/closeout.c @@ -22,11 +22,7 @@ #include "closeout.h" #include - #include -#ifndef errno -extern int errno; -#endif #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/lib/dup-safer.c b/lib/dup-safer.c index f72fd845f..4a820387e 100644 --- a/lib/dup-safer.c +++ b/lib/dup-safer.c @@ -22,9 +22,6 @@ #endif #include -#ifndef errno -extern int errno; -#endif #if HAVE_FCNTL_H # include diff --git a/lib/dup2.c b/lib/dup2.c index 32afed50f..58d4ad283 100644 --- a/lib/dup2.c +++ b/lib/dup2.c @@ -22,9 +22,6 @@ #endif #include -#ifndef errno -extern int errno; -#endif #if HAVE_FCNTL_H # include diff --git a/lib/exclude.c b/lib/exclude.c index 55f1a3918..bfc5a1665 100644 --- a/lib/exclude.c +++ b/lib/exclude.c @@ -28,9 +28,6 @@ #include #include -#ifndef errno -extern int errno; -#endif #include #include #include diff --git a/lib/fopen-safer.c b/lib/fopen-safer.c index 6825f9b9f..ee41efa13 100644 --- a/lib/fopen-safer.c +++ b/lib/fopen-safer.c @@ -31,10 +31,6 @@ #endif #include -#ifndef errno -extern int errno; -#endif - #include #include diff --git a/lib/ftruncate.c b/lib/ftruncate.c index adf87f64b..c062fe80d 100644 --- a/lib/ftruncate.c +++ b/lib/ftruncate.c @@ -79,9 +79,6 @@ ftruncate (int fd, off_t length) # else /* not F_CHSIZE nor F_FREESP nor HAVE_CHSIZE */ # include -# ifndef errno -extern int errno; -# endif int ftruncate (int fd, off_t length) diff --git a/lib/full-write.c b/lib/full-write.c index 151370563..0e15f790c 100644 --- a/lib/full-write.c +++ b/lib/full-write.c @@ -28,9 +28,6 @@ #endif #include -#ifndef errno -extern int errno; -#endif #ifdef FULL_READ # include "safe-read.h" diff --git a/lib/getcwd.c b/lib/getcwd.c index 2968a6e98..e502078ff 100644 --- a/lib/getcwd.c +++ b/lib/getcwd.c @@ -21,12 +21,7 @@ #include #include - #include -#ifndef errno -extern int errno; -#endif - #include #include "pathmax.h" diff --git a/lib/lchown.c b/lib/lchown.c index ec754eac8..b04fb3646 100644 --- a/lib/lchown.c +++ b/lib/lchown.c @@ -22,9 +22,7 @@ #include #include #include -#ifndef errno -extern int errno; -#endif + #include "lchown.h" #include "stat-macros.h" diff --git a/lib/memcoll.c b/lib/memcoll.c index 34ae767db..72ae17f64 100644 --- a/lib/memcoll.c +++ b/lib/memcoll.c @@ -24,10 +24,6 @@ #include "memcoll.h" #include -#ifndef errno -extern int errno; -#endif - #include /* Compare S1 (with length S1LEN) and S2 (with length S2LEN) according diff --git a/lib/putenv.c b/lib/putenv.c index 87c552281..2d194046c 100644 --- a/lib/putenv.c +++ b/lib/putenv.c @@ -26,10 +26,7 @@ /* Include errno.h *after* sys/types.h to work around header problems on AIX 3.2.5. */ #include -#if !_LIBC -# if !defined errno -extern int errno; -# endif +#ifndef __set_errno # define __set_errno(ev) ((errno) = (ev)) #endif diff --git a/lib/rmdir.c b/lib/rmdir.c index 55fee53c0..ddb5c30b2 100644 --- a/lib/rmdir.c +++ b/lib/rmdir.c @@ -22,11 +22,7 @@ #include #include - #include -#ifndef errno -extern int errno; -#endif #include "stat-macros.h" diff --git a/lib/savedir.c b/lib/savedir.c index 01499a9ae..c92e62ead 100644 --- a/lib/savedir.c +++ b/lib/savedir.c @@ -28,9 +28,6 @@ #include #include -#ifndef errno -extern int errno; -#endif #if HAVE_DIRENT_H # include diff --git a/lib/setenv.c b/lib/setenv.c index c3f9dc4ca..ae4174af2 100644 --- a/lib/setenv.c +++ b/lib/setenv.c @@ -21,10 +21,7 @@ #include #include -#if !_LIBC -# if !defined errno && !defined HAVE_ERRNO_DECL -extern int errno; -# endif +#ifndef __set_errno # define __set_errno(ev) ((errno) = (ev)) #endif diff --git a/lib/stat.c b/lib/stat.c index 2088db391..df0be3a81 100644 --- a/lib/stat.c +++ b/lib/stat.c @@ -27,9 +27,6 @@ #include #include #include -#ifndef errno -extern int errno; -#endif #if defined LSTAT && ! LSTAT_FOLLOWS_SLASHED_SYMLINK # include # include diff --git a/lib/utime.c b/lib/utime.c index 7b87a969d..3cac548d4 100644 --- a/lib/utime.c +++ b/lib/utime.c @@ -34,9 +34,6 @@ #include #include -#ifndef errno -extern int errno; -#endif #include "full-write.h" #include "safe-read.h" diff --git a/lib/xgetcwd.c b/lib/xgetcwd.c index 2089b8897..5147f51bc 100644 --- a/lib/xgetcwd.c +++ b/lib/xgetcwd.c @@ -23,10 +23,6 @@ #include #include -#ifndef errno -extern int errno; -#endif - #include #include diff --git a/lib/xmemcoll.c b/lib/xmemcoll.c index 0e30aef15..89d6fa8e4 100644 --- a/lib/xmemcoll.c +++ b/lib/xmemcoll.c @@ -22,10 +22,6 @@ #endif #include -#ifndef errno -extern int errno; -#endif - #include #include "gettext.h" diff --git a/lib/xreadlink.c b/lib/xreadlink.c index 41f5242ea..2e66c07f2 100644 --- a/lib/xreadlink.c +++ b/lib/xreadlink.c @@ -27,10 +27,6 @@ #include #include -#ifndef errno -extern int errno; -#endif - #include #include #include -- cgit v1.2.3-54-g00ecf