[Fakeroot-commits] [SCM] fakeroot branch, master, updated. debian/1.14.3-200-gb232f8a

Kyle J. McKay mackyle at gmail.com
Tue Aug 23 13:03:44 UTC 2011


The following commit has been merged in the master branch:
commit c0dcb550cd91ca9c9af73eaee1df86cc984af90c
Author: Kyle J. McKay <mackyle at gmail.com>
Date:   Mon May 30 15:49:19 2011 -0700

    Add Mac OS X 10.4 compatibility

diff --git a/communicate.h b/communicate.h
index d20a436..2d784c5 100644
--- a/communicate.h
+++ b/communicate.h
@@ -49,14 +49,26 @@
 # include <sys/feature_tests.h>
 #endif
 
+#ifdef __APPLE__
+# include <AvailabilityMacros.h>
+# ifndef MAC_OS_X_VERSION_10_5 1050
+#  define MAC_OS_X_VERSION_10_5 1050
+# endif
+# if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
+#  define HAVE_APPLE_STAT64 1
+# endif
+#endif
+
 /* Then decide whether we do or do not use the stat64 support */
-#if defined __APPLE__ \
+#if defined HAVE_APPLE_STAT64 \
 	|| (defined(sun) && !defined(__SunOS_5_5_1) && !defined(_LP64)) \
 	|| (!defined __UCLIBC__ && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1))) \
 	|| (defined __UCLIBC__ && defined __UCLIBC_HAS_LFS__)
 # define STAT64_SUPPORT
 #else
-# warning Not using stat64 support
+# ifndef __APPLE__
+#  warning Not using stat64 support
+# endif
 /* if glibc is 2.0 or older, undefine these again */
 # undef STAT64_SUPPORT
 # undef _LARGEFILE64_SOURCE
diff --git a/libfakeroot_inode64.c b/libfakeroot_inode64.c
index 9de18f1..572823b 100644
--- a/libfakeroot_inode64.c
+++ b/libfakeroot_inode64.c
@@ -25,6 +25,8 @@
 #include "config.h"
 #include "communicate.h"
 
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
+
 #include <stdio.h>
 #ifdef HAVE_SYS_ACL_H
 #include <sys/acl.h>
@@ -131,5 +133,6 @@ FTSENT *fts_children$INODE64(FTS *ftsp,
 
   return first;
 }
+#endif /* MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 */
 #endif /* HAVE_FTS_READ */
 #endif /* ifdef __APPLE__ */
diff --git a/libfakeroot_unix2003.c b/libfakeroot_unix2003.c
index 7a7e76b..43d7ea7 100644
--- a/libfakeroot_unix2003.c
+++ b/libfakeroot_unix2003.c
@@ -29,6 +29,8 @@
 #include "config.h"
 #include "communicate.h"
 
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
+
 #ifdef STUPID_ALPHA_HACK
 #define SEND_STAT(a,b,c) send_stat(a,b,c)
 #define SEND_STAT64(a,b,c) send_stat64(a,b,c)
@@ -227,4 +229,5 @@ getattrlist$UNIX2003(const char *path, void *attrList, void *attrBuf,
 
   return 0;
 }
+#endif /* MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 */
 #endif /* if defined __APPLE__ && !defined __LP64__ */
diff --git a/patchattr.h b/patchattr.h
index d6c62ce..e77fe15 100644
--- a/patchattr.h
+++ b/patchattr.h
@@ -15,12 +15,18 @@
 #include <sys/attr.h>
 #include <sys/mount.h>
 
-#ifndef ATTR_CMN_RETURNED_ATTRS
-#define ATTR_CMN_RETURNED_ATTRS                 0x80000000
+#ifndef ATTR_CMN_FILEID
+#define ATTR_CMN_FILEID                         0x02000000
+#endif
+#ifndef ATTR_CMN_PARENTID
+#define ATTR_CMN_PARENTID                       0x04000000
 #endif
 #ifndef ATTR_CMN_FULLPATH
 #define ATTR_CMN_FULLPATH                       0x08000000
 #endif
+#ifndef ATTR_CMN_RETURNED_ATTRS
+#define ATTR_CMN_RETURNED_ATTRS                 0x80000000
+#endif
 
 #ifdef LIBFAKEROOT_DEBUGGING
 extern int fakeroot_debug;
diff --git a/wrapfunc.inp b/wrapfunc.inp
index 4c11a5a..a9c1b67 100644
--- a/wrapfunc.inp
+++ b/wrapfunc.inp
@@ -43,11 +43,15 @@ getattrlist;int;(const char *path, void *attrList, void *attrBuf, size_t attrBuf
 #ifdef HAVE_FGETATTRLIST
 fgetattrlist;int;(int fd, void *attrList, void *attrBuf, size_t attrBufSize, unsigned long options);(fd, attrList, attrBuf, attrBufSize, options)
 #endif
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
 getattrlist$UNIX2003;int;(const char *path, void *attrList, void *attrBuf, size_t attrBufSize, unsigned long options);(path, attrList, attrBuf, attrBufSize, options)
 #endif
+#endif
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
 lstat$INODE64;int;(const char *file_name, struct stat *buf);(file_name, buf)
 stat$INODE64;int;(const char *file_name, struct stat *buf);(file_name, buf)
 fstat$INODE64;int;(int fd, struct stat *buf);(fd, buf)
+#endif
 #endif /* ifdef __APPLE__ */
 
 WRAP_MKNOD;int;MKNOD_ARG(int ver, const char *pathname, mode_t mode, dev_t XMKNOD_FRTH_ARG dev);MKNOD_ARG(ver, pathname, mode, dev);MKNOD
@@ -73,9 +77,11 @@ fchmod;int;(int fd, mode_t mode);(fd, mode)
 lchmod;int;(const char *path, mode_t mode);(path, mode)
 #endif
 #if defined __APPLE__ && !defined __LP64__
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
 lchown$UNIX2003;int;(const char *path, uid_t owner, gid_t group);(path, owner, group)
 chmod$UNIX2003;int;(const char *path, mode_t mode);(path, mode)
 fchmod$UNIX2003;int;(int fd, mode_t mode);(fd, mode)
+#endif
 #endif /* if defined __APPLE__ && !defined __LP64__ */
 mkdir;int;(const char *path, mode_t mode);(path, mode)
 unlink;int;(const char *pathname);(pathname)
@@ -105,8 +111,10 @@ setegid;int;(gid_t id);(id)
 setreuid;int;(SETREUID_ARG ruid, SETREUID_ARG euid);(ruid, euid)
 setregid;int;(SETREGID_ARG rgid, SETREGID_ARG egid);(rgid, egid)
 #if defined __APPLE__ && !defined __LP64__
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
 setreuid$UNIX2003;int;(SETREUID_ARG ruid, SETREUID_ARG euid);(ruid, euid)
 setregid$UNIX2003;int;(SETREGID_ARG rgid, SETREGID_ARG egid);(rgid, egid)
+#endif
 #endif /* if defined __APPLE__ && !defined __LP64__ */
 #ifdef HAVE_GETRESUID
 getresuid;int;(uid_t *ruid, uid_t *euid, uid_t *suid);(ruid, euid, suid)
@@ -158,12 +166,16 @@ acl_set_file;int;(const char *path_p, acl_type_t type, acl_t acl);(path_p, type,
 #ifdef HAVE_FTS_READ
 fts_read;FTSENT *;(FTS *ftsp);(ftsp)
 #ifdef __APPLE__
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
 fts_read$INODE64;FTSENT *;(FTS *ftsp);(ftsp)
+#endif
 #endif /* ifdef __APPLE__ */
 #endif /* HAVE_FTS_READ */
 #ifdef HAVE_FTS_CHILDREN
 fts_children;FTSENT *;(FTS *ftsp, int options);(ftsp, options)
 #ifdef __APPLE__
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
 fts_children$INODE64;FTSENT *;(FTS *ftsp, int options);(ftsp, options)
+#endif
 #endif /* ifdef __APPLE__ */
 #endif /* HAVE_FTS_CHILDREN */

-- 
fakeroot



More information about the Fakeroot-commits mailing list