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

Clint Adams schizo at debian.org
Tue Aug 23 13:05:42 UTC 2011


The following commit has been merged in the upstream branch:
commit 675369003c106f9265c142ccf5bc29e30a13bc91
Author: Clint Adams <schizo at debian.org>
Date:   Sun Oct 2 15:40:01 2005 +0000

    vorlon's alpha fix
    
    git-archimport-id: fakeroot at packages.debian.org--fakeroot/fakeroot--main--0.0--patch-87

diff --git a/communicate.c b/communicate.c
index 070d8d2..65f87ed 100644
--- a/communicate.c
+++ b/communicate.c
@@ -201,8 +201,12 @@ void cpystatfakem(struct stat *st, const struct fake_msg *f
 #ifdef STAT64_SUPPORT
 
 void cpyfakemstat64(struct fake_msg *f,
-                 const struct stat64 *st){
-  
+                 const struct stat64 *st
+#ifdef STUPID_ALPHA_HACK
+                 , int ver
+#endif
+                 ){
+#ifndef STUPID_ALPHA_HACK
   f->st.mode =st->st_mode;
   f->st.ino  =st->st_ino ;
   f->st.uid  =st->st_uid ;
@@ -219,9 +223,54 @@ void cpyfakemstat64(struct fake_msg *f,
      to occur in practical fakeroot conditions. */
 
   f->st.nlink=st->st_nlink;
+#else
+  switch(ver) {
+	  case _STAT_VER_KERNEL:
+  f->st.mode  = ((struct fakeroot_kernel_stat *)st)->st_mode;
+  f->st.ino   = ((struct fakeroot_kernel_stat *)st)->st_ino;
+  f->st.uid   = ((struct fakeroot_kernel_stat *)st)->st_uid;
+  f->st.gid   = ((struct fakeroot_kernel_stat *)st)->st_gid;
+  f->st.dev   = ((struct fakeroot_kernel_stat *)st)->st_dev;
+  f->st.rdev  = ((struct fakeroot_kernel_stat *)st)->st_rdev;
+  f->st.nlink = ((struct fakeroot_kernel_stat *)st)->st_nlink;
+  break;
+	  case _STAT_VER_GLIBC2:
+  f->st.mode  = ((struct fakeroot_glibc2_stat *)st)->st_mode;
+  f->st.ino   = ((struct fakeroot_glibc2_stat *)st)->st_ino;
+  f->st.uid   = ((struct fakeroot_glibc2_stat *)st)->st_uid;
+  f->st.gid   = ((struct fakeroot_glibc2_stat *)st)->st_gid;
+  f->st.dev   = ((struct fakeroot_glibc2_stat *)st)->st_dev;
+  f->st.rdev  = ((struct fakeroot_glibc2_stat *)st)->st_rdev;
+  f->st.nlink = ((struct fakeroot_glibc2_stat *)st)->st_nlink;
+  break;
+	  case _STAT_VER_GLIBC2_1:
+  f->st.mode  = ((struct fakeroot_glibc21_stat *)st)->st_mode;
+  f->st.ino   = ((struct fakeroot_glibc21_stat *)st)->st_ino;
+  f->st.uid   = ((struct fakeroot_glibc21_stat *)st)->st_uid;
+  f->st.gid   = ((struct fakeroot_glibc21_stat *)st)->st_gid;
+  f->st.dev   = ((struct fakeroot_glibc21_stat *)st)->st_dev;
+  f->st.rdev  = ((struct fakeroot_glibc21_stat *)st)->st_rdev;
+  f->st.nlink = ((struct fakeroot_glibc21_stat *)st)->st_nlink;
+  break;
+		  default:
+  f->st.mode  = st->st_mode;
+  f->st.ino   = st->st_ino;
+  f->st.uid   = st->st_uid;
+  f->st.gid   = st->st_gid;
+  f->st.dev   = st->st_dev;
+  f->st.rdev  = st->st_rdev;
+  f->st.nlink = st->st_nlink;
+  break;
+  }
+#endif
 }
 void cpystat64fakem(struct stat64 *st,
-                 const struct fake_msg *f){
+                 const struct fake_msg *f
+#ifdef STUPID_ALPHA_HACK
+                 , int ver
+#endif
+                 ){
+#ifndef STUPID_ALPHA_HACK
   st->st_mode =f->st.mode;
   st->st_ino  =f->st.ino ;
   st->st_uid  =f->st.uid ;
@@ -231,6 +280,42 @@ void cpystat64fakem(struct stat64 *st,
   /* DON'T copy the nlink count! The system always knows
      this one better! */
   /*  st->st_nlink=f->st.nlink;*/
+#else
+  switch(ver) {
+	  case _STAT_VER_KERNEL:
+  ((struct fakeroot_kernel_stat *)st)->st_mode = f->st.mode;
+  ((struct fakeroot_kernel_stat *)st)->st_ino  = f->st.ino;
+  ((struct fakeroot_kernel_stat *)st)->st_uid  = f->st.uid;
+  ((struct fakeroot_kernel_stat *)st)->st_gid  = f->st.gid;
+  ((struct fakeroot_kernel_stat *)st)->st_dev  = f->st.dev;
+  ((struct fakeroot_kernel_stat *)st)->st_rdev = f->st.rdev;
+  break;
+	  case _STAT_VER_GLIBC2:
+  ((struct fakeroot_glibc2_stat *)st)->st_mode = f->st.mode;
+  ((struct fakeroot_glibc2_stat *)st)->st_ino  = f->st.ino;
+  ((struct fakeroot_glibc2_stat *)st)->st_uid  = f->st.uid;
+  ((struct fakeroot_glibc2_stat *)st)->st_gid  = f->st.gid;
+  ((struct fakeroot_glibc2_stat *)st)->st_dev  = f->st.dev;
+  ((struct fakeroot_glibc2_stat *)st)->st_rdev = f->st.rdev;
+  break;
+		  case _STAT_VER_GLIBC2_1:
+  ((struct fakeroot_glibc21_stat *)st)->st_mode = f->st.mode;
+  ((struct fakeroot_glibc21_stat *)st)->st_ino  = f->st.ino;
+  ((struct fakeroot_glibc21_stat *)st)->st_uid  = f->st.uid;
+  ((struct fakeroot_glibc21_stat *)st)->st_gid  = f->st.gid;
+  ((struct fakeroot_glibc21_stat *)st)->st_dev  = f->st.dev;
+  ((struct fakeroot_glibc21_stat *)st)->st_rdev = f->st.rdev;
+  break;
+		  default:
+  st->st_mode =f->st.mode;
+  st->st_ino  =f->st.ino ;
+  st->st_uid  =f->st.uid ;
+  st->st_gid  =f->st.gid ;
+  st->st_dev  =f->st.dev ;
+  st->st_rdev =f->st.rdev;
+  break;
+  }
+#endif
 }
 
 #endif /* STAT64_SUPPORT */
@@ -571,14 +656,22 @@ void send_stat(const struct stat *st,
 
 #ifdef STAT64_SUPPORT
 void send_stat64(const struct stat64 *st,
-                 func_id_t f){
+                 func_id_t f
+#ifdef STUPID_ALPHA_HACK
+                 , int ver
+#endif
+                 ){
   struct fake_msg buf;
 
 #ifndef FAKEROOT_FAKENET
   if(init_get_msg()!=-1)
 #endif /* ! FAKEROOT_FAKENET */
   {
+#ifndef STUPID_ALPHA_HACK
     cpyfakemstat64(&buf,st);
+#else
+    cpyfakemstat64(&buf,st,ver);
+#endif
     buf.id=f;
     send_fakem(&buf);
   }
@@ -613,7 +706,11 @@ void send_get_stat(struct stat *st
 }
 
 #ifdef STAT64_SUPPORT
-void send_get_stat64(struct stat64 *st)
+void send_get_stat64(struct stat64 *st
+#ifdef STUPID_ALPHA_HACK
+                     , int ver
+#endif
+                    )
 {
   struct fake_msg buf;
 
@@ -621,11 +718,19 @@ void send_get_stat64(struct stat64 *st)
   if(init_get_msg()!=-1)
 #endif /* ! FAKEROOT_FAKENET */
   {
+#ifndef STUPID_ALPHA_HACK
     cpyfakemstat64(&buf,st);
+#else
+    cpyfakemstat64(&buf,st,ver);
+#endif
 
     buf.id=stat_func;
     send_get_fakem(&buf);
+#ifndef STUPID_ALPHA_HACK
     cpystat64fakem(st,&buf);
+#else
+    cpystat64fakem(st,&buf,ver);
+#endif
   }
 }
 #endif /* STAT64_SUPPORT */
diff --git a/communicate.h b/communicate.h
index 72467a5..6583cc9 100644
--- a/communicate.h
+++ b/communicate.h
@@ -153,8 +153,13 @@ extern void unlock_comm_sd(void);
 #endif /* FAKEROOT_FAKENET */
 
 #ifdef STAT64_SUPPORT  
+#ifndef STUPID_ALPHA_HACK
 extern void send_stat64(const struct stat64 *st, func_id_t f);
 extern void send_get_stat64(struct stat64 *buf);
+#else
+extern void send_stat64(const struct stat64 *st, func_id_t f, int ver);
+extern void send_get_stat64(struct stat64 *buf, int ver);
+#endif
 extern void stat64from32(struct stat64 *s64, const struct stat *s32);
 extern void stat32from64(struct stat *s32, const struct stat64 *s64);
 #endif
diff --git a/debian/changelog b/debian/changelog
index 6636318..e6de885 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+fakeroot (1.5.3) unstable; urgency=low
+
+  * Patch from Steve Langasek to "schmunge the alpha stat struct
+    conversion hackery to apply to the stat64 family of calls as well"
+
+ -- Clint Adams <schizo at debian.org>  Sun,  2 Oct 2005 11:35:51 -0400
+
 fakeroot (1.5.2) unstable; urgency=low
 
   * Patch from Matthias Klose to add support for i386,
diff --git a/libfakeroot.c b/libfakeroot.c
index 3198e05..0bfa083 100644
--- a/libfakeroot.c
+++ b/libfakeroot.c
@@ -539,8 +539,11 @@ int WRAP_LSTAT64 LSTAT64_ARG (int ver,
   if(r)
     return -1;
 
+#ifndef STUPID_ALPHA_HACK
   send_get_stat64(st);
-
+#else
+  send_get_stat64(st,ver);
+#endif
   return 0;
 }
 
@@ -553,7 +556,11 @@ int WRAP_STAT64 STAT64_ARG(int ver,
   r=NEXT_STAT64(ver,file_name,st);
   if(r)
     return -1;
+#ifndef STUPID_ALPHA_HACK
   send_get_stat64(st);
+#else
+  send_get_stat64(st,ver);
+#endif
   return 0;
 }
 
@@ -566,7 +573,11 @@ int WRAP_FSTAT64 FSTAT64_ARG(int ver,
   r=NEXT_FSTAT64(ver, fd, st);
   if(r)
     return -1;
+#ifndef STUPID_ALPHA_HACK
   send_get_stat64(st);
+#else
+  send_get_stat64(st,ver);
+#endif
 
   return 0;
 }
@@ -856,8 +867,12 @@ int unlink(const char *pathname){
     return -1;
   
 #ifdef STAT64_SUPPORT
+#ifndef STUPID_ALPHA_HACK
   send_stat64(&st, unlink_func);
 #else
+  send_stat64(&st, unlink_func, _STAT_VER);
+#endif
+#else
   send_stat(&st, unlink_func);
 #endif
   

-- 
fakeroot



More information about the Fakeroot-commits mailing list