diff options
author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-12-02 01:50:58 +0000 |
---|---|---|
committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2005-12-02 01:50:58 +0000 |
commit | 6fd3ac79613c9e1832513b0f614860be2735993f (patch) | |
tree | 5f6bfb750aed249d5951d84de663c03f9e4b82dd /libc/sysdeps/linux/common/getdents.c | |
parent | 9acef89e60381a298801e4b221d66b1538072b28 (diff) | |
download | uClibc-alpine-6fd3ac79613c9e1832513b0f614860be2735993f.tar.bz2 uClibc-alpine-6fd3ac79613c9e1832513b0f614860be2735993f.tar.xz |
Merge from trunk.
Diffstat (limited to 'libc/sysdeps/linux/common/getdents.c')
-rw-r--r-- | libc/sysdeps/linux/common/getdents.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/common/getdents.c b/libc/sysdeps/linux/common/getdents.c index 876420664..24ce2c8ba 100644 --- a/libc/sysdeps/linux/common/getdents.c +++ b/libc/sysdeps/linux/common/getdents.c @@ -28,7 +28,7 @@ #include <sys/types.h> #include <sys/syscall.h> - +#undef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) struct kernel_dirent @@ -90,7 +90,7 @@ ssize_t attribute_hidden __getdents (int fd, char *buf, size_t nbytes) dp->d_off = kdp->d_off; dp->d_reclen = new_reclen; dp->d_type = DT_UNKNOWN; - memcpy (dp->d_name, kdp->d_name, + __memcpy (dp->d_name, kdp->d_name, kdp->d_reclen - offsetof (struct kernel_dirent, d_name)); dp = (struct dirent *) ((char *) dp + new_reclen); kdp = (struct kernel_dirent *) (((char *) kdp) + kdp->d_reclen); |