summaryrefslogtreecommitdiff
path: root/ufs/dir.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1997-08-20 19:06:42 +0000
committerThomas Bushnell <thomas@gnu.org>1997-08-20 19:06:42 +0000
commit7b01458f66d04a90e8497bd60f1baa7eb79b9d6a (patch)
treeb81d77f74bfb35d39e7b3a356ff16067f22cb63a /ufs/dir.c
parent56c05885be4c655fc18c119dbb87527bf5b9af86 (diff)
Wed Aug 20 14:34:24 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* dir.c (diskfs_lookup_hard): Cope with error return from diskfs_get_filemap. * sizes.c (diskfs_grow): Likewise. * dir.c (diskfs_dirempty): Cope (poorly) with error return from diskfs_get_filemap. * sizes.c (diskfs_truncate): Likewise. (block_extended): Likewise. * pager.c (diskfs_get_filemap): If pager_create fails, return error to caller.
Diffstat (limited to 'ufs/dir.c')
-rw-r--r--ufs/dir.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ufs/dir.c b/ufs/dir.c
index 6c44932d..bdf84be6 100644
--- a/ufs/dir.c
+++ b/ufs/dir.c
@@ -1,5 +1,5 @@
/* Directory management routines
- Copyright (C) 1994, 1995, 1996 Free Software Foundation
+ Copyright (C) 1994, 1995, 1996, 1997 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
@@ -145,6 +145,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);
@@ -727,6 +731,11 @@ diskfs_dirempty(struct node *dp,
error_t err;
memobj = diskfs_get_filemap (dp, VM_PROT_READ);
+
+ if (memobj == MACH_PORT_NULL)
+ /* XXX should reflect error properly */
+ return 0;
+
buf = 0;
err = vm_map (mach_task_self (), &buf, dp->dn_stat.st_size, 0,