Sophie

Sophie

distrib > Mageia > 2 > i586 > by-pkgid > 6b5201a344458de54b366f7b5c893b53 > files > 56

glibc-2.14.1-11.2.mga2.src.rpm

From 75b4202ab03337edb37536e3d9470a48a04c9341 Mon Sep 17 00:00:00 2001
From: David S. Miller <davem@davemloft.net>
Date: Thu, 10 Oct 2013 22:32:36 -0700
Subject: [PATCH] Fix readdir regressions on sparc 32-bit.

        * sysdeps/unix/dirstream.h (struct __dirstream): Fix alignment of
        directory block.

diff -Nurp glibc-2.14.1.orig/sysdeps/unix/dirstream.h glibc-2.14.1/sysdeps/unix/dirstream.h
--- glibc-2.14.1.orig/sysdeps/unix/dirstream.h	2013-10-06 18:29:01.952008563 +0300
+++ glibc-2.14.1/sysdeps/unix/dirstream.h	2013-10-11 15:08:32.428426856 +0300
@@ -42,8 +42,13 @@ struct __dirstream
 
     int errcode;		/* Delayed error code.  */
 
-    /* Directory block.  */
-    char data[0] __attribute__ ((aligned (__alignof__ (void*))));
+    /* Directory block.  We must make sure that this block starts
+       at an address that is aligned adequately enough to store
+       dirent entries.  Using the alignment of "void *" is not
+       sufficient because dirents on 32-bit platforms can require
+       64-bit alignment.  We use "long double" here to be consistent
+       with what malloc uses.  */
+    char data[0] __attribute__ ((aligned (__alignof__ (long double))));
   };
 
 #define _DIR_dirfd(dirp)	((dirp)->fd)