summaryrefslogtreecommitdiff
path: root/ext2fs/dir.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1997-08-20 19:04:25 +0000
committerThomas Bushnell <thomas@gnu.org>1997-08-20 19:04:25 +0000
commitfaf7ed89435b12a4a58b2ec0357e124bdc830b45 (patch)
treedbf598eda93785e5d27abe691b98a8eb4a61fba3 /ext2fs/dir.c
parent3fe6d879dd6efb066188a07e06d9db10659e7e8f (diff)
Wed Aug 20 14:28:00 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* dir.c (diskfs_lookup_hard): Cope with error return from diskfs_get_filemap. (diskfs_dirempty): Cope (poorly) with error return from diskfs_get_filemap. * truncate.c (force_delayed_copies): Likewise. * pager.c (diskfs_get_filemap): If pager_create fails, return error to caller.
Diffstat (limited to 'ext2fs/dir.c')
-rw-r--r--ext2fs/dir.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ext2fs/dir.c b/ext2fs/dir.c
index a31df4e2..f1ea285c 100644
--- a/ext2fs/dir.c
+++ b/ext2fs/dir.c
@@ -1,6 +1,6 @@
/* Directory management routines
- Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
Converted for ext2fs by Miles Bader <miles@gnu.ai.mit.edu>
@@ -153,6 +153,10 @@ diskfs_lookup_hard (struct node *dp, char *name, enum lookup_type type,
/* Map in the directory contents. */
memobj = diskfs_get_filemap (dp, prot);
+
+ if (memobj == MACH_PORT_NULL)
+ return errno;
+
buf = 0;
/* We allow extra space in case we have to do an EXTEND. */
buflen = round_page (dp->dn_stat.st_size + DIRBLKSIZ);
@@ -716,6 +720,10 @@ diskfs_dirempty (struct node *dp, struct protid *cred)
int hit = 0; /* Found something in the directory. */
memory_object_t memobj = diskfs_get_filemap (dp, VM_PROT_READ);
+ if (memobj == MACH_PORT_NULL)
+ /* XXX should reflect error properly. */
+ return 0;
+
err = vm_map (mach_task_self (), &buf, dp->dn_stat.st_size, 0,
1, memobj, 0, 0, VM_PROT_READ, VM_PROT_READ, 0);
mach_port_deallocate (mach_task_self (), memobj);