aboutsummaryrefslogtreecommitdiff
path: root/tmpfs/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmpfs/dir.c')
-rw-r--r--tmpfs/dir.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/tmpfs/dir.c b/tmpfs/dir.c
index 25b99bd8..65386e0a 100644
--- a/tmpfs/dir.c
+++ b/tmpfs/dir.c
@@ -58,9 +58,6 @@ diskfs_get_directs (struct node *dp, int entry, int n,
struct dirent *entp;
int i;
- assert (offsetof (struct tmpfs_dirent, name)
- >= offsetof (struct dirent, d_name));
-
if (bufsiz == 0)
bufsiz = dp->dn_stat.st_size
+ 2 * ((offsetof (struct dirent, d_name[3]) + 7) & ~7);
@@ -247,7 +244,7 @@ diskfs_direnter_hard (struct node *dp, const char *name,
> tmpfs_page_limit)
return ENOSPC;
- new = malloc (entsize);
+ new = malloc (offsetof (struct tmpfs_dirent, name) + namelen + 1);
if (new == 0)
return ENOSPC;