Please consider the attached patch for inclusion in the mainstream
coreutils source.


* gnulib-tests/test-sameacls.c

  Corrects erroneous usage of AIX aclx_get() and aclx_printStr(),
  causing the test-sameacls test to fail on AIX.


* src/uname.c

  Providing processor type on AIX (uname -p)


Best Regards --Jørn Amundsen
Index: coreutils-7.2-aix/gnulib-tests/test-sameacls.c
===================================================================
--- coreutils-7.2-aix.orig/gnulib-tests/test-sameacls.c	2008-10-14 12:04:44.000000000 +0200
+++ coreutils-7.2-aix/gnulib-tests/test-sameacls.c	2009-03-31 22:16:04.000000000 +0200
@@ -444,34 +444,38 @@
   size_t aclsize1 = sizeof (acl1);
   mode_t mode1;
   char text1[1000];
+  size_t textsize1;
   acl_type_t type2;
   char acl2[1000];
   size_t aclsize2 = sizeof (acl2);
   mode_t mode2;
   char text2[1000];
+  size_t textsize2;
 
-  memset (&type1, 0, sizeof (type1)); /* type1 = ACL_ANY */
+  type1.u64 = ACL_ANY;
   if (aclx_get (file1, 0, &type1, acl1, &aclsize1, &mode1) < 0)
     {
       fprintf (stderr, "error accessing the ACLs of file %s\n", file1);
       fflush (stderr);
       abort ();
     }
-  if (aclx_printStr (text1, sizeof (text1), acl1, aclsize1, type1, file1, 0) < 0)
+  textsize1 = sizeof (text1);
+  if (aclx_printStr (text1, &textsize1, acl1, aclsize1, type1, file1, 0) < 0)
     {
       fprintf (stderr, "cannot convert the ACLs of file %s to text\n", file1);
       fflush (stderr);
       abort ();
     }
 
-  memset (&type2, 0, sizeof (type2)); /* type2 = ACL_ANY */
+  type2.u64 = ACL_ANY;
   if (aclx_get (file2, 0, &type2, acl2, &aclsize2, &mode2) < 0)
     {
       fprintf (stderr, "error accessing the ACLs of file %s\n", file2);
       fflush (stderr);
       abort ();
     }
-  if (aclx_printStr (text2, sizeof (text2), acl2, aclsize2, type2, file2, 0) < 0)
+  textsize2 = sizeof (text2);
+  if (aclx_printStr (text2, &textsize2, acl2, aclsize2, type2, file2, 0) < 0)
     {
       fprintf (stderr, "cannot convert the ACLs of file %s to text\n", file2);
       fflush (stderr);
Index: coreutils-7.2-aix/src/uname.c
===================================================================
--- coreutils-7.2-aix.orig/src/uname.c	2009-03-29 19:43:41.000000000 +0200
+++ coreutils-7.2-aix/src/uname.c	2009-03-31 15:39:58.000000000 +0200
@@ -50,6 +50,10 @@
 # include <mach-o/arch.h>
 #endif
 
+#ifdef _AIX
+#include <sys/systemcfg.h>
+#endif
+
 #include "system.h"
 #include "error.h"
 #include "quote.h"
@@ -309,6 +313,20 @@
 	  element = processor;
       }
 #endif
+#ifdef _AIX
+      switch (_system_configuration.architecture)
+      {
+	case POWER_RS:
+	  element = "power";
+	  break;
+	case POWER_PC:
+	  element = "powerpc";
+	  break;
+	case IA64:
+	  element = "ia64";
+	  break;
+      }
+#endif
 #ifdef UNAME_PROCESSOR
       if (element == unknown)
 	{
_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to