summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-06-21 16:19:57 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-06-21 16:19:57 +0000
commite9d286f1c83643eb3e04cf45f733f3c61726808e (patch)
tree8e2be0be9795802810a8751e302494f3ae5b6244
parent7999b65e416f1314e0bab62655faeeaa8a355580 (diff)
(diskfs_lookup): Provide initialization for BUFLEN.
(diskfs_direnter): Move assignment out of if test.
-rw-r--r--ufs/dir.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/ufs/dir.c b/ufs/dir.c
index aeaa5abc..1d7004d8 100644
--- a/ufs/dir.c
+++ b/ufs/dir.c
@@ -1,5 +1,5 @@
/* Directory management routines
- Copyright (C) 1994 Free Software Foundation
+ Copyright (C) 1994, 1995 Free Software Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -96,7 +96,7 @@ diskfs_lookup (struct node *dp, char *name, enum lookup_type type,
int retry_dotdot = 0;
memory_object_t memobj;
vm_address_t buf = 0;
- vm_size_t buflen;
+ vm_size_t buflen = 0;
int blockaddr;
int idx;
@@ -520,11 +520,14 @@ diskfs_direnter(struct node *dp,
oldsize = dp->dn_stat.st_size;
while (oldsize + DIRBLKSIZ > dp->allocsize)
- if (err = diskfs_grow (dp, oldsize + DIRBLKSIZ, cred))
- {
- vm_deallocate (mach_task_self (), ds->mapbuf, ds->mapextent);
- return err;
- }
+ {
+ err = diskfs_grow (dp, oldsize + DIRBLKSIZ, cred);
+ if (err)
+ {
+ vm_deallocate (mach_task_self (), ds->mapbuf, ds->mapextent);
+ return err;
+ }
+ }
new = (struct directory_entry *) (ds->mapbuf + oldsize);