diff options
author | Ulrich Drepper <drepper@redhat.com> | 2007-08-03 03:35:12 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2007-08-03 03:35:12 +0000 |
commit | fa39685d5c7df2502213418bead44e9543a9b9ec (patch) | |
tree | 3a5058c9fe7f0cc0ee1a50f0f068131fecc9d78d /sysdeps/unix/dirstream.h | |
parent | 9b2e9577b228350b15d88303b00097dd58e8d29b (diff) | |
download | glibc-fa39685d5c7df2502213418bead44e9543a9b9ec.tar.gz glibc-fa39685d5c7df2502213418bead44e9543a9b9ec.tar.xz glibc-fa39685d5c7df2502213418bead44e9543a9b9ec.zip |
* sysdeps/unix/opendir.c (__alloc_dir): Don't initialize ->data.
Avoid memset, add explicit initialization. * sysdeps/unix/dirstream.h (struct __dirstream): Move data elemtn to the end and change into zero-sized array. Move lock member to fill a hole on 64-bit platforms.
Diffstat (limited to 'sysdeps/unix/dirstream.h')
-rw-r--r-- | sysdeps/unix/dirstream.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sysdeps/unix/dirstream.h b/sysdeps/unix/dirstream.h index b1d80f0017..8303f07fab 100644 --- a/sysdeps/unix/dirstream.h +++ b/sysdeps/unix/dirstream.h @@ -17,7 +17,6 @@ 02111-1307 USA. */ #ifndef _DIRSTREAM_H - #define _DIRSTREAM_H 1 #include <sys/types.h> @@ -35,12 +34,14 @@ struct __dirstream __libc_lock_define (, lock) /* Mutex lock for this structure. */ - char *data; /* Directory block. */ size_t allocation; /* Space allocated for the block. */ size_t size; /* Total valid data in the block. */ size_t offset; /* Current offset into the block. */ off_t filepos; /* Position of next entry to read. */ + + /* Directory block. */ + char data[0] __attribute__ ((aligned (__alignof__ (void*)))); }; #define _DIR_dirfd(dirp) ((dirp)->fd) |