bug-cpio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-cpio] [PATCH] cpio 2.11 : need to declare stat? (build failure unde


From: Naohiro Aota
Subject: [Bug-cpio] [PATCH] cpio 2.11 : need to declare stat? (build failure under Gentoo/FreeBSD)
Date: Sat, 20 Mar 2010 02:11:57 +0900
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Hi all,

I had problem with cpio building under Gentoo/FreeBSD (nearly same with
ordinary FreeBSD).

The build message was like this.

.-------------------------------------------------------------------------------
|   CC     copyin.o
| In file included from copyin.c:25:
| filetypes.h:85:11: error: macro "stat" requires 2 arguments, but only 1 given
| In file included from copyin.c:25:
| filetypes.h:85: error: 'stat' redeclared as different kind of symbol
| /usr/include/sys/stat.h:331: error: previous declaration of 'stat' was here
| gmake[2]: *** [copyin.o] Error 1
`-------------------------------------------------------------------------------

I found that "cpio/gnu/sys/stat.h" defines "stat" macro when
REPLACE_STAT is set to "1". This definition might cause the build
failure.

I've applied the patch below and was able to build cpio. (Maybe
declaring stat and lstat isn't necessary anymore? because now
"cpio/gnu/sys/stat.h" think of them?)

# I think this patch might fix Marius's bug too. Please try the patch if
# you don't mind.

Regards,
Naohiro

diff --git a/src/filetypes.h b/src/filetypes.h
index f80faab..63e7881 100644
--- a/src/filetypes.h
+++ b/src/filetypes.h
@@ -82,4 +82,6 @@
 #define lstat stat
 #endif
 int lstat ();
+#ifndef stat
 int stat ();
+#endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]