summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-08-02 22:41:37 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-08-02 22:41:37 +0000
commitfd0ca86dd2c3e7b349b9aae76e1dd5ba1c669ed6 (patch)
tree8d6892e167dcfe630b151ad643ee069ab3fd6910
parent2b9bdc6ee0bf1546e72f1367090e7392f0d571ff (diff)
downloadcoreutils-fd0ca86dd2c3e7b349b9aae76e1dd5ba1c669ed6.tar.xz
(errno): Remove decl; we now assume C89 or better.
-rw-r--r--lib/canonicalize.c10
-rw-r--r--lib/chown.c3
-rw-r--r--lib/closeout.c4
-rw-r--r--lib/dup-safer.c3
-rw-r--r--lib/dup2.c3
-rw-r--r--lib/exclude.c3
-rw-r--r--lib/fopen-safer.c4
-rw-r--r--lib/ftruncate.c3
-rw-r--r--lib/full-write.c3
-rw-r--r--lib/getcwd.c5
-rw-r--r--lib/lchown.c4
-rw-r--r--lib/memcoll.c4
-rw-r--r--lib/putenv.c5
-rw-r--r--lib/rmdir.c4
-rw-r--r--lib/savedir.c3
-rw-r--r--lib/setenv.c5
-rw-r--r--lib/stat.c3
-rw-r--r--lib/utime.c3
-rw-r--r--lib/xgetcwd.c4
-rw-r--r--lib/xmemcoll.c4
-rw-r--r--lib/xreadlink.c4
21 files changed, 6 insertions, 78 deletions
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 <sys/file.h>
#endif
#include <errno.h>
-#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 <stdio.h>
-
#include <errno.h>
-#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 <errno.h>
-#ifndef errno
-extern int errno;
-#endif
#if HAVE_FCNTL_H
# include <fcntl.h>
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 <errno.h>
-#ifndef errno
-extern int errno;
-#endif
#if HAVE_FCNTL_H
# include <fcntl.h>
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 <ctype.h>
#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
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 <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-
#include <stdio.h>
#include <stdio-safer.h>
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 <errno.h>
-# 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 <errno.h>
-#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 <stdlib.h>
#include <string.h>
-
#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-
#include <sys/types.h>
#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 <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
-#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 <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-
#include <string.h>
/* 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 <errno.h>
-#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 <sys/types.h>
#include <sys/stat.h>
-
#include <errno.h>
-#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 <sys/types.h>
#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
#if HAVE_DIRENT_H
# include <dirent.h>
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 <alloca.h>
#include <errno.h>
-#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 <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
#if defined LSTAT && ! LSTAT_FOLLOWS_SLASHED_SYMLINK
# include <stdlib.h>
# include <string.h>
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 <unistd.h>
#include <errno.h>
-#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 <stdio.h>
#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-
#include <sys/types.h>
#include <stdlib.h>
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 <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-
#include <stdlib.h>
#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 <stdio.h>
#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-
#include <limits.h>
#include <sys/types.h>
#include <stdlib.h>