aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2003-11-28 11:23:07 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2003-11-28 11:23:07 +0000
commit99dfb315e097b21571a655461d8cd7adfb77352f (patch)
tree38da17ecf80c12861bf41eb7ff213b945933779c
parent41972568e898cd435026e4a4337f452a5402ca6b (diff)
downloadcpio-99dfb315e097b21571a655461d8cd7adfb77352f.tar.gz
cpio-99dfb315e097b21571a655461d8cd7adfb77352f.tar.bz2
Fixed handling of undeclared errno
-rw-r--r--mkdir.c3
-rw-r--r--mt.c14
-rw-r--r--rtapelib.c2
-rw-r--r--util.c1
4 files changed, 14 insertions, 6 deletions
diff --git a/mkdir.c b/mkdir.c
index 84b47ff..aa1c4ff 100644
--- a/mkdir.c
+++ b/mkdir.c
@@ -22,7 +22,8 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
-#ifndef errno
+
+#if !HAVE_DECL_ERRNO
extern int errno;
#endif
diff --git a/mt.c b/mt.c
index 23d1d0a..41f6801 100644
--- a/mt.c
+++ b/mt.c
@@ -83,12 +83,20 @@
#include <strings.h>
#endif
-#if defined(STDC_HEADERS)
-#include <stdlib.h>
-#else
+#if defined(HAVE_STDLIB_H)
+# include <stdlib.h>
+#endif
+
+#if !HAVE_DECL_ERRNO
extern int errno;
+#endif
+#if !HAVE_DECL_GETENV
char *getenv ();
+#endif
+#if !HAVE_DECL_ATOI
int atoi ();
+#endif
+#if !HAVE_DECL_EXIT
void exit ();
#endif
diff --git a/rtapelib.c b/rtapelib.c
index f41626e..34d38ad 100644
--- a/rtapelib.c
+++ b/rtapelib.c
@@ -52,7 +52,7 @@
#include <setjmp.h>
#include <sys/stat.h>
-#ifndef errno
+#if! HAVE_DECL_ERRNO
extern int errno;
#endif
diff --git a/util.c b/util.c
index 6449b66..9918fdc 100644
--- a/util.c
+++ b/util.c
@@ -1051,7 +1051,6 @@ chown (path, owner, group)
int
utime (char *filename, struct utimbuf *utb)
{
- extern int errno;
struct tm *tm;
struct ftime filetime;
time_t when;

Return to:

Send suggestions and report system problems to the System administrator.